Skip to content

Cannot run tests on Windows #3707

@Download

Description

@Download

You want to:

  • report a bug
  • request a feature

Current behaviour

When I run npm test after git cloning and npm installing this repo, I get:

C:\ws\socketio>npm test

> [email protected] test C:\ws\socketio
> npm run format:check && npm run compile && nyc mocha --require ts-node/register --reporter spec --slow 200 --bail --timeout 10000 test/socket.io.ts


> [email protected] format:check C:\ws\socketio
> prettier --check "lib/**/*.ts" "test/**/*.ts"

Checking formatting...
All matched files use Prettier code style!

> [email protected] compile C:\ws\socketio
> rimraf ./dist && tsc

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'C:\ws\socketio\node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|
npm ERR! Test failed.  See above for more details.

I traced this down to this issue in nyc, which is fixed in 15.0.0+.

Steps to reproduce (if the current behaviour is a bug)

On a Windows 10 computer:

  • Clone project
  • npm install
  • npm test

Expected behaviour

Should run the tests.

Setup

  • OS: Windows 10
  • browser: n/a/
  • socket.io version: master

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Preparing a PR to fix this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions