Giter Site home page Giter Site logo

mock-socket's Introduction

Javascript mocking library for websockets and socket.io

Build Status

Contents

Installation

npm install mock-socket
import { WebSocket, Server } from 'mock-socket';

Usage

import test from 'ava';
import { Server } from 'mock-socket';

class ChatApp {
  constructor(url) {
    this.messages = [];
    this.connection = new WebSocket(url);

    this.connection.onmessage = event => {
      this.messages.push(event.data);
    };
  }

  sendMessage(message) {
    this.connection.send(message);
  }
}

test.cb('that chat app can be mocked', t => {
  const fakeURL = 'ws://localhost:8080';
  const mockServer = new Server(fakeURL);

  mockServer.on('connection', socket => {
    socket.on('message', data => {
      t.is(data, 'test message from app', 'we have intercepted the message and can assert on it');
      socket.send('test message from mock server');
    });
  });

  const app = new ChatApp(fakeURL);
  app.sendMessage('test message from app'); // NOTE: this line creates a micro task

  // NOTE: this timeout is for creating another micro task that will happen after the above one
  setTimeout(() => {
    t.is(app.messages.length, 1);
    t.is(app.messages[0], 'test message from mock server', 'we have stubbed our websocket backend');
    mockServer.stop(t.done);
  }, 100);
});

Advanced Usage

Stubbing the "global"

import { WebSocket, Server } from 'mock-socket';

/*
 * By default the global WebSocket object is stubbed out when 
 * a new Server instance is created and is restored when you stop
 * the server.
 * However, you can disable this behavior by passing `mock: false`
 * to the options and manually mock the socket when you need it.
 */
const server = new Server('ws://localhost:8080', { mock: false });

/*
 * If you need to stub something else out you can like so:
 */

window.WebSocket = WebSocket; // Here we stub out the window object

Server Methods

const mockServer = new Server('ws://localhost:8080');

mockServer.on('connection', socket => {
  socket.on('message', () => {});
  socket.on('close', () => {});
  socket.on('error', () => {});

  socket.send('message');
  socket.close();
});

mockServer.clients(); // array of all connected clients
mockServer.emit('room', 'message');
mockServer.stop(optionalCallback);

Typescript Support

A declaration file is included by default. If you notice any issues with the types please create an issue or a PR!

Socket IO

Socket.IO has limited support. Below is a similar example to the one above but modified to show off socket.io support.

import test from 'ava';
import { SocketIO, Server } from 'mock-socket';

class ChatApp {
  constructor(url) {
    this.messages = [];
    this.connection = new io(url);

    this.connection.on('chat-message', data => {
      this.messages.push(event.data);
    });
  }

  sendMessage(message) {
    this.connection.emit('chat-message', message);
  }
}

test.cb('that socket.io works', t => {
  const fakeURL = 'ws://localhost:8080';
  const mockServer = new Server(fakeURL);

  window.io = SocketIO;

  mockServer.on('connection', socket => {
    socket.on('chat-message', data => {
      t.is(data, 'test message from app', 'we have intercepted the message and can assert on it');
      socket.emit('chat-message', 'test message from mock server');
    });
  });

  const app = new ChatApp(fakeURL);
  app.sendMessage('test message from app');

  setTimeout(() => {
    t.is(app.messages.length, 1);
    t.is(app.messages[0], 'test message from mock server', 'we have subbed our websocket backend');

    mockServer.stop(t.done);
  }, 100);
});

Contributing

The easiest way to work on the project is to clone the repo down via:

git clone [email protected]:thoov/mock-socket.git
cd mock-socket
yarn install

Then to create a local build via:

yarn build

Then create a local npm link via:

yarn link

At this point you can create other projects / apps locally and reference this local build via:

yarn link mock-socket

from within your other projects folder. Make sure that after any changes you run yarn build!

Tests

This project uses ava.js as its test framework. Tests are located in /tests. To run tests:

yarn test

Linting

This project uses eslint and a rules set from airbnb's javascript style guides. To run linting:

yarn lint

Formatting

This project uses prettier. To run the formatting:

yarn format

Code Coverage

Code coverage reports are created in /coverage after all of the tests have successfully passed. To run the coverage:

yarn test:coverage

Feedback

If you have any feedback, encounter any bugs, or just have a question, please feel free to create a github issue or send me a tweet at @thoov.

mock-socket's People

Contributors

32bitkid avatar albertseo avatar atrue avatar ccummings avatar dependabot[bot] avatar fffw avatar frank3k avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hachichaud avatar izebb avatar johnbaileyn avatar jonasdev avatar kenta-s avatar kiyui avatar kukiel avatar m00k avatar pablobirukov avatar pthm avatar rafagarcia avatar regseb avatar rileytg avatar rwilander avatar sechel avatar steveluscher avatar thoov avatar tomalec avatar vadym-tarasich avatar vlizard avatar yodaddyp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mock-socket's Issues

Unit tests breaking in Firefox

Hi,

my unit tests are breaking in Firefox every time there is something depending on a a message being received from the MockServer. I thought I messed something up in my code, but after checking in more detail, realized out even your unit tests break in firefox, e.g.

Unit - EventTarget: adding/removing "message" event listeners works (1, 0, 1)Rerun1 ms

    Expected 3 assertions, but 0 were run

I've figured out it's because in createMessageEvent the messageEvent.type property gets lost and then no listeners are found in dispatchEvent. So adding it back like you did with .data and .origin helps, but some other tests still break. In general, the tests behave very strange, I have to shutdown Firefox completely because after the first time, all the tests break on refresh.

server.on("connection", ...) returns the server instance instead of the client socket instance

Per this library it doesn't seem possible to simulate socket.io clients emitting events.

I can only emit events from the server.

var Server = require("mock-server").Server
var mockServer = new Server("http://localhost:1111")

mockServer.on("connection", function(socket){
  // socket === mockServer
  // this makes no sense. socket should be the
  // client socket which connected, not the server.

  // in the real socket.io lib, socket is the client instance
})

In my code, I attach event listeners to the socket which connected, and I'm trying to simulate those. Is this possible using another method?

server.close() does not work??

describe.only('Websockets store handlers', () => {
  let store;

  beforeEach(() => {
    store = createStore(ws,
      applyMiddleware(
        thunk,
        promise,
      )
    );
  });

  it('connects the websocket', () => {
    const server = new Server('ws://qorus.example.com/log/main');

    store.subscribe(() => {
      const { data } = store.getState();

      expect(data).to.eql({
        'log/main': {
          loading: true,
          connected: false,
          error: false,
          paused: false,
        },
      });
    });

    store.dispatch(actions.connect('log/main'));

    server.close();
  });

  it('disconnects the websocket', () => {
    const server = new Server('ws://qorus.example.com/log/main');

    store.dispatch(actions.connect('log/main'));
    store.subscribe(() => {
      const { data } = store.getState();

      expect(data).to.eql({
        'log/main': {
          loading: false,
          connected: false,
          error: false,
          paused: false,
        },
      });
    });
    store.dispatch(actions.disconnect('log/main'));

    server.close();
  });
});
  1. Websockets store handlers disconnects the websocket:
    Error: A mock server is already listening on this url

serverLookup on network-bridge does not find the server according to the given url

I am expecting the on message handler I attach to the server to be fired when the websocket sends any message, and it doesnt

After debugging I found that the websocket.js does not find the server to dispatch the event
Please help

server.js creates a server instance:

image

websocket.js does not find the server:

image

Of course the url is the same in the server.js and websocket.js
Looks like the urlMap is empty:
image

Sockets send messages multiple times

I'm running into a problem while testing in Node. The server seems to receive more messages than are sent. It gets as many copies of a message as there are sockets connected. So if you have 3 sockets connected the server will receive 3 copies of every message. Below is a Mocha test case I wrote to find the issue in case it helps.

describe('MockSocket', function() {
it ('server should only receive as many messages as are sent', function(done) {

        var url = 'ws://localhost:8080';

        var server = new MockServer(url);

        var num_messages_sent = 0;
        var num_messages_received = 0;

        server.on('connection', function (socket) {
            socket.on('message', function (event) {
                console.log("RECEIVED: " + event.data);
                num_messages_received++;
            });
        });

        var s1 = new MockSocket(url);
        s1.onopen = function () {
            num_messages_sent++;
            s1.send("1");
        };

        var s2 = new MockSocket(url);
        s2.onopen = function () {
            num_messages_sent++;
            s2.send("2");
        };

        setInterval(function () {
            assert.equal(num_messages_received, num_messages_sent);
                            done();
        }, 500);
    }
});

An in-range update of eslint-config-airbnb-base is breaking the build 🚨

Version 11.1.1 of eslint-config-airbnb-base just got published.

Branch Build failing 🚨
Dependency eslint-config-airbnb-base
Current Version 11.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-config-airbnb-base is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • dependency-ci Dependencies checked Details

  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Error: Could not find module `mock-socket` imported from `(require)`

Just tried to use this lib in my ember-test environment. I simply installed it with npm.

Importing it like this:

var mockWebSocket = require('mock-socket').WebSocket;
var mockServer = require('mock-socket').Server;

Or like this:

import { WebSocket, Server } from 'mock-socket';

Results in the same error:

Error: Could not find module `mock-socket` imported from `(require)`
    at missingModule (http://localhost:4201/assets/vendor.js:173:11)
    at findModule (http://localhost:4201/assets/vendor.js:188:17)
    at requireModule (http://localhost:4201/assets/vendor.js:177:12)
    at Module.callback (http://localhost:4201/assets/tests.js:406:23)
    at Module.exports (http://localhost:4201/assets/vendor.js:92:34)
    at Module.build (http://localhost:4201/assets/vendor.js:142:10)
    at findModule (http://localhost:4201/assets/vendor.js:190:9)
    at requireModule (http://localhost:4201/assets/vendor.js:177:12)
    at Object.TestLoader.require (http://localhost:4201/assets/test-loader.js:67:9)
    at Object.TestLoader.loadModules (http://localhost:4201/assets/test-loader.js:58:18)

Am I doing something wrong?

Run mock-socket with jsdom

I ran into a pretty odd issue using this (great) library in conjunction with jsdom. When you use jsdom you override global.window with a window obj provided by jsdom. This is causing issues with mock-socket because it looks for the Event class in window, and jsdom provides a partially implemented version of Event that does implement the same signature that we find in the standard browser event. Thus, the passed type and config params get ignored and we have an event with no type that cannot be routed to a listener. We don't have this problem with Other Event Types (e.g. CloseEvent) because mock-socket doesn't find them in jsdom's provided window obj and library defaults to NodeEvent.

Proposed Solution

I think we should change the way the library determines if we're running in node or not. Currently if the window object is defined that the globalContext is set to window. Obviously for those using jsdom (or I imagine any other node library that spoofs the browser) things fall apart. The answer in this SO thread (http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser) recommends using something akin to this === window to determine such cases. I think this is an elegant solution. If you're running jsdom, it should say we're using Node.

If the maintainers think this is a good approach, I'll gladly throw up a pr for this.

bower install mock-socket not working

When I do bower install --save-dev mock-socket for version ^6.0.1
There is no mock-socket.js (or mock-socket.min.js) file anywhere
in the installed source.

I can see the file in the GitHub repo, but for whatever reason, it does not
show up when installed by bower.

An in-range update of eslint-plugin-import is breaking the build 🚨

Version 2.1.0 of eslint-plugin-import just got published.

Branch Build failing 🚨
Dependency eslint-plugin-import
Current Version 2.0.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-import is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • dependency-ci Failed dependency checks Details

Commits

The new version differs by 28 commits .

  • 7205904 Merge remote-tracking branch 'origin/master' into release-2.1.0
  • 29bc56e Ignoring flow type exports (#639)
  • 1186409 first draft of release steps in RELEASE.md
  • bf0c8e2 bump resolvers/webpack/v0.7.0
  • 53cd2cd Revert "absenteeism disclaimer"
  • 954db1a bump v2.1.0
  • 2602b5d Add deprecated flags to imports-first metadata (#625)
  • cf42834 changelog: rule link fixes
  • 162155e Merge remote-tracking branch 'ljharb/use_cwd'
  • 024a8a7 Fixed documentation for the default values for the order rule (fixes #601)`
  • c640615 chore(package): update cross-env to version 3.1.0 (#606)
  • afe0a3a Add no-named-default rule (#596)
  • edbb570 chore(package): update mocha to version 3.1.2
  • de0dbe5 newline-after-import with decorators (#595)
  • 34bf9bd chore(package): update doctrine to version 1.5.0

There are 28 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of babel-loader is breaking the build 🚨

Version 6.3.1 of babel-loader just got published.

Branch Build failing 🚨
Dependency babel-loader
Current Version 6.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-loader is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • dependency-ci Dependencies checked Details

  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v6.3.1

🐛 Bug Fix

  • The new forceEnv options wasn't working as expected (#379) @chrisvasz
Commits

The new version differs by 5 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

setTimeout on websocket close handler

I'm sure this reasoning could apply to other areas in the code base... but it seems if you want websocket to mimic its real life counterpart, all the functionaliy inside websocket.close() should happen behind a setTimeout call.

Currently I'm writing a test verify that the readyState on the websocket is set to CLOSING immediately after I invoke websocket.close. Because websocket.close occurs synchronously it's impossible to test for this. Thoughts?

BUG: MockSockIO `on` only adds one handler per event type

Description

Basically, on wraps the callback supplied to handle the case where MessageEvent is used versus a raw object.

Code Comment

Regular WebSockets expect a MessageEvent but Socketio.io just wants raw data
payload instanceof MessageEvent works, but you can't isntance of NodeEvent
for now we detect if the output has data defined on it

This creates a bug where there is only ever one handler possible per event type and it never warns you of this failure.

Additionally, this on wrapper prevents us from removing handlers because the function is unknown.

Reproduce

See test in Pull Request

Resolution

See Pull Reuqest

Binary messages?

I could not find anything about it supporting binary messages. Does this library support mocking of binary messages?

How to migrate from 0.4 to 0.8?

I have tests using Intern and Chai that run with 0.4.1 but upgrading to any other version fails badly.

Specifically, in 0.8.0, all WS connections fail.

Couldn't find this covered anywhere.

Thanks for the great work!

socket.io

Does this work with socket.io? I've read somewhere that socket.io doesn't use standard websocket protocol

MockServer events

It looks like MockServer is intended to emulate the WebSocketServer from ws. One difference though is that ws passes in strings rather than objects on socket events. For example:

socket_server.on('connection', function(socket) {
socket.on('message', function (message) {
// using ws message is a string containing the event data
// using MockServer message is an event object
});
}

If the intent is to make MockServer play nice with ws, matching ws's behavior would be a welcome change.

MockServer close event

Hi,

I was trying to implement a reconnection strategy when the websocket is not cleanly closed.
But it appears that the event returned when subscribing to MockSocket.onclose is not compatible with the standard CloseEvent https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent.
Some data are missing like code, reason and wasClean.

It would be interesting to get them.
What do you think about this ?

Closing `server` sets `websocket.readyState` to `undefined`

For version 2.0.0:

If you call server.close() somehow websocket.readyStategets set to undefined. readyState should be set to 3 or WebSocket.CLOSED.

I wrote a little mocha test to verify this bug:

it.only('calling close on server sets client readyState to WebSocket.CLOSED', done => {
    const server = new Server('ws://localhost:8080');
    const socket = new WebSocket('ws://localhost:8080');

    socket.onopen = function open() {
      server.close();
    }

    socket.onclose = function close() {
      assert.equal(socket.readyState, WebSocket.CLOSED);
      done();
    }
  });

Named messages

We use socket.io and we name our events. It looks like this lib uses message for each event name - is this a ws/standards thing? Is it possible to name an event?

For example if my mock server did this

mockServer.on('connection', function(server) {
  server.emit('encode:add', {some: 'data'});
});

my socket.io client code would expect to be able to do this

connection.on('encode:add', function(data) {
  console.log(data); // {some: 'data'}
});

Question about using MockServer

Hi, I am trying to use your library to mock web socket server in my unit tests. I run my tests in Chrome. Unfortunately "mocking" does not happen for me. I do create the instance of MockServer with correct url but when the code I test tries to open WebSocket I get an exception "WebSocket connection to 'ws://127.0.0.1:8585/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED". I think I do everything correctly. I was hoping you could point me in the right direction. Thank you, Anna

An in-range update of nyc is breaking the build 🚨

Version 8.4.0 of nyc just got published.

Branch Build failing 🚨
Dependency nyc
Current Version 8.3.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As nyc is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • dependency-ci Failed dependency checks Details

  • continuous-integration/travis-ci/push The Travis CI build passed Details

Commits

The new version differs by 6 commits .

  • aa9ab4f chore(release): 8.4.0
  • b90d26f fix: reverts _maybeInstrumentSource logic, so that exclude is still applied (#429)
  • 63a8758 feat: read coverage header when using "noop" instrumenter (#420)
  • 92dedda feat: coverage information is now returned for process tree (#416)
  • ac31339 chore(package): update tap to version 8.0.0 (#427)
  • 4945dac fix: update core istanbul libraries (#426)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Multiple sockets share connection

If you create multiple sockets pointing to the same server they will all share a single connection (i.e. when one is connected they all are, when a message is sent to one they all receive it, etc.)

NOTE: I ran into this running mocha tests in Node.

Tests don't test the code properly

Since introducing babelJS to the repo, dist files are built with "use strict" directive inside, which is definitely good. Test bundle doesn't include it because of this line. That means that tests are executed in non-strict mode while the actual code will be running in strict mode.

It'd be good to somehow solve the issue with qunit and remove blacklisting strict transformer.

Update url parsing

Currently the url parsing is done with a "hack". This should be done be either a 3rd party library or w/ something like new URL('testing.com')

Can't Import From ES6

I am trying to import your library like this:

import 'mock-socket'

However when I run this through webpack I get an error:

ERROR in ./~/mock-socket/src/main.js
Module parse failed: /Users/saul/projects/caido/node_modules/mock-socket/src/main.js Line 1: Unexpected reserved word
You may need an appropriate loader to handle this file type.
| import Service from './service';
| import MockServer from './mock-server';
| import MockSocket from './mock-socket';
 @ ./app/debug.js 9:0-22

I am able to import other JS libraries fine. Any ideas?

re-assigning onclose does not get rid of the old event listener

re-assigning the following to a WebSocket instance does not remove the old event listener, which is not the case for real sockets

  onopen
  onmessage
  onclose
  onerror

Example code would be:

let ws = new WebSocket('ws://localhost:8080')
ws.onclose = () => console.log('listener 1')
ws.onclose = () => console.log('listener 2')

In a browser only listener 2 would be logged.

Missing `off` method on MockSocketIO client

Loving the project

Deciding How to Implement off

I noticed that the MockSocketIO is missing the method off. I went to implement my own to do a PR then noticed a design decision was made for on. Basically, on wraps the callback to handle the case where MessageEvent is used versus a raw object

Regular WebSockets expect a MessageEvent but Socketio.io just wants raw data
payload instanceof MessageEvent works, but you can't isntance of NodeEvent
for now we detect if the output has data defined on it

Thus, the wrapper prevents us from easily being able to implement off because the reference is not the same as the one externally supplied to on

@thoov Do you have a suggestion? I would love to help, but I see this decision was made and didn't want to start down a path that I hadn't considered first. It is not clear to me why we don't off load the responsibility of handling the MessageEvent vs raw object to the external implementation or within Server.to.

Is it possible to mock connection timeout ?

Is it possible to delay a message by X ms ? specifically the connect message in my case.

I'm trying to test timeouts in some RPC implementation using web sockets. The specific scenario i'm trying to test is the app opening a websocket connection, hitting some internal timeout, notifying the user and setting state to disconnected, then the ws onconnect is invoked in wich case i'm just closing the connection. I have similar scenarios with send as well.

I've seen that you use some "timing hacks" (as you call them) to delay messages (currently set to 4ms). Is it possible to use that some how for my use case?

Thanks.

Emit function parameters (Client and Server) do not mirror Socket.io API

Hi @thoov,

I have been using your library at work for unit testing a Socket.io based application we are making. I have contributed to the library in Issue #79 in order to add some missing functionality we needed in our app.

When running tests I am running into an issue were the API for mock-socket's emit function is not aligned with Socket.io's emit function.

The Socket.io API for emit is emit(event, ...data), which allows for variable amounts of data args to be passed to the callback function listening to the specified event name.

The mock-socket API for emit is emit(event, data, options) for the server and emit(event, data) for the client. The mock-socket API does not allow for variable amounts of data args to be passed. We could pass all of our data as an object, but I feel this incorrect.

I looked into making the changes necessary to correct this but it would be a major change to libraries API. I would be willing to do the work to make the modifications to align the API between the two libraries. Before doing this work I wanted first to talk to you about why the API was structured this way and your ideas on how to correct it.

Thanks!

Question: Where did dist go (v1.0.4)?

@thoov Probably for good reasons, but where did dist go? I bower install --save-dev mock-socket and upgraded to 1.0.4 only to discover that the referenced "main": "dist/mock-socket.js", in bower.json doesn't exist.

Ember test support.

Hi, thank you for the lib.
I tried to use it in my Ember qunit acceptance tests and faced error with Ember run loop.
You can't use setTimout in ember tests without wrapping it with promise object or using Ember.run.later.

I understand the lib is supposed to be used not only in Ember environment, but can we include RSVP promises and wrap delay code with it or should I just fork it?

An in-range update of cross-env is breaking the build 🚨

Version 3.2.0 of cross-env just got published.

Branch Build failing 🚨
Dependency cross-env
Current Version 3.1.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As cross-env is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • dependency-ci Dependencies checked Details

  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v3.2.0

<a name"3.2.0">

3.2.0 (2017-03-04)

Features

  • revamp: revamp the entire lib (backward compatible) (#63) (dad00c46)
Commits

The new version differs by 4 commits .

  • dad00c4 feat(revamp): revamp the entire lib (backward compatible) (#63)
  • e33a85c docs(README): Add doc for cross-var. (#58)
  • 5e590ec docs(README): added how to use cross-env to run npm sub-scripts (#53)
  • afdb2de docs(README): mention Bash on Windows (#49)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

punycode not found

Error: Cannot find module './punycode' from '/Users/rileytg/code/logview/node_modules/mock-socket/dist'

Unable to import `require('mock-socket')`

require('mock-socket')

require('mock-socket')

{}

require('mock-socket').MockServer

undefined

var MockServer = require('mock-socket')

undefined

MockServer

{}

var server = new MockServer()

TypeError: MockServer is not a function
at repl:1:14
at REPLServer.defaultEval (repl.js:248:27)
at bound (domain.js:280:14)
at REPLServer.runBound as eval
at REPLServer. (repl.js:412:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:549:8)
at REPLServer.Interface._ttyWrite (readline.js:826:14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.