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

Tests pass even when error occurs in tests #147

Open
glentakahashi opened this issue Jun 25, 2019 · 1 comment
Open

Tests pass even when error occurs in tests #147

glentakahashi opened this issue Jun 25, 2019 · 1 comment

Comments

@glentakahashi
Copy link
Contributor

Right now if you experience an error with puppeteer or the code itself, the tests still pass. E.g.:
(this specific issue of slashes in test names is fixed, but it still fails on other issues as well)

  console.log node_modules/differencify/dist/utils/logger.js:64
    14:43:32 tests that nginx functions the same as app for /mypage: Executing page.toMatchSnapshot step

  console.log node_modules/differencify/dist/utils/logger.js:64
    14:43:32 tests that nginx functions the same as app for /mypage: screenshot saved in -> /test/__image_snapshots__/tests that nginx functions the same as app for /mypage.snap.png

  console.error console.js:188
    Trace: 14:43:32 tests that nginx functions the same as app for /mypage: { Error: ENOENT: no such file or directory, open '/test/__image_snapshots__/tests that nginx functions the same as app for /mypage.snap.png'
        at Object.fs.openSync (fs.js:646:18)
        at Object.fs.writeFileSync (fs.js:1299:33)
        at writeFileSync (/test/node_modules/differencify/src/compareImage.js:124:6)
        at Target._evaluateResult (/test/node_modules/differencify/src/target.js:255:29)
        at Target._evaluateResult (/test/node_modules/differencify/src/target.js:242:31)
        at handleAsyncFunc (/test/node_modules/differencify/src/helpers/functions.js:2:67)
        at Target._handleFunc (/test/node_modules/differencify/src/target.js:99:45)
        at ChainObject.end (/test/node_modules/differencify/src/helpers/proxyChain.js:40:24)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:189:7)
      errno: -2,
      code: 'ENOENT',
      syscall: 'open',
      path: '/test/__image_snapshots__/tests that nginx functions the same as app for /mypage.snap.png' }
        at Logger.trace (/test/node_modules/differencify/src/utils/logger.js:66:15)
        at PrefixedLogger.trace (/test/node_modules/differencify/src/utils/logger.js:23:17)
        at Target.trace [as _logError] (/test/node_modules/differencify/src/target.js:27:25)
        at Target._logError [as _evaluateResult] (/test/node_modules/differencify/src/target.js:257:14)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:189:7)

  console.log node_modules/differencify/dist/utils/logger.js:64
    14:43:32 Closing browser...


 RUNS  ...

 PASS  ./test.js (205.754s)```
@NimaSoroush
Copy link
Owner

Hi @glentakahashi , do you have an example of your test structure which you can post here?

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