Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run tests #2311

Open
VatsalBhuva11 opened this issue Oct 4, 2023 · 1 comment
Open

Unable to run tests #2311

VatsalBhuva11 opened this issue Oct 4, 2023 · 1 comment

Comments

@VatsalBhuva11
Copy link

I'm trying to implement a new validator. I've added the required test cases, and manually tested the validator. However, I'm unable to run any tests using npm test. I get the following error:

Run npm test

> validator@13.11.0 pretest /home/runner/work/validator.js/validator.js
> npm run build && npm run lint


> validator@13.11.0 build /home/runner/work/validator.js/validator.js
> run-p build:*


> validator@13.11.0 build:es /home/runner/work/validator.js/validator.js
> babel src -d es --env-name=es


> validator@13.11.0 build:browser /home/runner/work/validator.js/validator.js
> node --require @babel/register build-browser && npm run minify


> validator@13.11.0 build:node /home/runner/work/validator.js/validator.js
> babel src -d .

Successfully compiled 108 files with Babel (3[4](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:5)37ms).
Successfully compiled 108 files with Babel (4093ms).

> validator@13.11.0 minify /home/runner/work/validator.js/validator.js
> uglifyjs validator.js -o validator.min.js  --compress --mangle --comments /Copyright/


> validator@13.11.0 lint /home/runner/work/validator.js/validator.js
> eslint src test

Cannot read property 'name' of null
TypeError: Cannot read property 'name' of null
    at checkForViolation (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/rules/no-shadow-restricted-names.js:34:39)
    at CatchClause (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/rules/no-shadow-restricted-names.js:6[5](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:6):17)
    at /home/runner/work/validator.js/validator.js/node_modules/eslint/lib/util/safe-emitter.js:47:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/util/safe-emitter.js:47:38)
    at NodeEventGenerator.applySelector (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/util/node-event-generator.js:251:2[6](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:7))
    at NodeEventGenerator.applySelectors (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/util/node-event-generator.js:2[8](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:9)0:22)
    at NodeEventGenerator.enterNode (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/util/node-event-generator.js:2[9](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:10)4:14)
    at CodePathAnalyzer.enterNode (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at Traverser.enter [as _enter] (/home/runner/work/validator.js/validator.js/node_modules/eslint/lib/linter.js:865:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! validator@13.11.0 lint: `eslint src test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the validator@13.11.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-[10](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:11)-04T[11](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:12)_43_51_[16](https://github.com/validatorjs/validator.js/actions/runs/6405494758/job/17388158234?pr=2310#step:5:17)6Z-debug.log
npm ERR! Test failed.  See above for more details.
Error: Process completed with exit code 1.

I cannot figure out the cause to it. I thought that the problem would be cause of some console.log() statements that I added in the validator, but even after commenting them out, I'm getting this error.

@manojmula
Copy link

can you share the logs and also the changes?

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

No branches or pull requests

2 participants