Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Blank schematic project failed to run unit test with error no such file or directory #860

Closed
mattma opened this issue May 6, 2018 · 1 comment

Comments

@mattma
Copy link

mattma commented May 6, 2018

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [ ] devkit
- [ x ] schematics

Versions

node --version
v8.9.4

npm --version
5.6.0

Repro steps

A blank schematics project generated with version 0.6.0.

npm run test

The log given by the failure

> npm run build && jasmine **/*_spec.js


> my-schematics@0.0.0 build /Users/***/my-schematics
> tsc -p tsconfig.json

fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/Users/mattma/Desktop/temp/my-schematics/node_modules/fsevents/node_modules/needle/test/keys/ssl.cert'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.<anonymous> (/Users/mattma/Desktop/temp/my-schematics/node_modules/fsevents/node_modules/needle/test/helpers.js:9:13)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)

Desired functionality

Unit Test passed

@vikikamath
Copy link

Updating jasmine **/*_spec.js to jasmine src/**/*.spec.js fixed it. Or you can add a postinstall script that does the following steps documented on needle npm module:
https://www.npmjs.com/package/needle#testing

$ mkdir -p test/keys
$ openssl genrsa -out test/keys/ssl.key 2048
$ openssl req -new -key test/keys/ssl.key -x509 -days 999 -out test/keys/ssl.cert

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants