validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

Unable to run tests

Open VatsalBhuva11 opened this issue 2 years ago • 1 comments

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

> [email protected] pretest /home/runner/work/validator.js/validator.js
> npm run build && npm run lint


> [email protected] build /home/runner/work/validator.js/validator.js
> run-p build:*


> [email protected] build:es /home/runner/work/validator.js/validator.js
> babel src -d es --env-name=es


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


> [email protected] 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).

> [email protected] minify /home/runner/work/validator.js/validator.js
> uglifyjs validator.js -o validator.min.js  --compress --mangle --comments /Copyright/


> [email protected] 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! [email protected] lint: `eslint src test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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.

VatsalBhuva11 avatar Oct 04 '23 11:10 VatsalBhuva11

can you share the logs and also the changes?

manojmula avatar Dec 01 '23 00:12 manojmula