question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do the tests ever fail?

See original GitHub issue

Description

For some reasons, I can’t get the test to fail. I added the following line:

diff --git a/definitions/npm/knex_v0.12.x/test_knex-v0.12.js b/definitions/npm/knex_v0.12.x/test_knex-v0.12.js
index efe9b50..0a203d1 100644
--- a/definitions/npm/knex_v0.12.x/test_knex-v0.12.js
+++ b/definitions/npm/knex_v0.12.x/test_knex-v0.12.js
@@ -42,6 +42,8 @@ knex('bar').del();
 // $ExpectError
 knex.from();

+knex.iCertainlyDontExistButIWontFail('blaaaa');
+
 knex.destroy();

 /**

As the function iCertainlyDontExistButIWontFail doesn’t exist in the Knex definition, I was expecting the tests to fail where I ran the script run_def_tests.sh but it reported that all the tests passed.

» ./run_def_tests.sh
npm WARN definitions@1.0.0 No description
npm WARN definitions@1.0.0 No repository field.

up to date in 0.788s

> definitions@1.0.0 test /path/to/dir/flowtype/flow-typed/definitions
> eslint npm/**/test*


/path/to/dir/flowtype/flow-typed/definitions/npm/backbone_v1.x.x/test_backbone-v1.x.x.js
  15:14  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  17:14  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  19:22  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  49:29  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  52:23  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  54:17  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  55:16  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/blacklist_v1.x.x/test_blacklist_v1.x.x.js
  4:33  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  5:37  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/bluebird_v3.x.x/test_bluebird_v3.x.x.js
   99:37  warning  Unexpected use of weak type "Object"    flowtype/no-weak-types
  121:47  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/bunyan_v1.x.x/test_bunyan_v1.x.x.js
  17:20  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/camelcase-keys_v3.x.x/test_camelcase-keys_v3.x.x.js
  3:15  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/commander_v2.x.x/test_commander_v2.x.x.js
  37:30  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/express_v4.x.x/test_express_v4.x.x.js
  71:23  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/fuzzaldrin_v2.x.x/test_fuzzaldrin_v2.js
  6:10  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/inquirer_v2.x.x/test_rx_observable_array_v2.x.x.js
  41:17  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/inquirer_v2.x.x/test_rx_observable_create_v2.x.x.js
  9:9  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/isomorphic-fetch_v2.x.x/test_isomorphic-fetch_v2.js
  7:25  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/koa-bunyan-logger_v2.x.x/test_koa_bunyan_logger_v2.x.x.js
  19:20  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/map-obj_v1.x.x/test_map-obj_v1.x.x.js
  3:18  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  3:79  warning  Unexpected use of weak type "any"     flowtype/no-weak-types
  3:92  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/mocha_v2.4.x/test_mocha_v2.4.x_hooks.js
   8:16  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  19:20  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  31:15  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  42:19  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/mocha_v2.4.x/test_mocha_v2.4.x_it.js
   8:20  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  26:25  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  46:25  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/mocha_v3.1.x/test_mocha_v3.1.x_hooks.js
   8:16  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  19:20  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  31:15  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  42:19  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/mocha_v3.1.x/test_mocha_v3.1.x_it.js
   9:20  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  25:25  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  43:25  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/morgan_v1.x.x/test_morgan.js
  29:58  warning  Unexpected use of weak type "any"  flowtype/no-weak-types
  29:68  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/node-fetch_v1.x.x/test_node-fetch_v1.js
  7:26  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/normalizr_v2.x.x/test_normalizr-v2.js
  4:40  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  5:42  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  8:25  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/object-assign_v4.x.x/test_object-assign_v4.x.x.js
  5:16  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  6:16  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/papaparse_v4.x.x/test_papaparse_v4.x.x.js
  28:17  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  31:25  warning  Unexpected use of weak type "any"     flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/primus_v5.x.x/test_primus-v5.js
  9:63  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/primus_v6.x.x/test_primus-v6.js
  9:63  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/prismic.io_v3.x.x/test_prismic.io_v3.x.x.js
   44:37  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
   49:44  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
   53:44  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
   55:72  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
   56:59  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
   71:27  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
   74:43  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  103:29  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  140:35  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  148:43  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  157:37  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  164:28  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  165:34  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  166:45  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  302:29  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/react-dnd_v2.x.x/test_react-dnd-v2.js
  72:26  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/react-select_v1.x.x/test_react-select_v1.x.x.js
   7:31  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  10:31  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  11:30  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  12:33  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  13:32  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  19:32  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  20:31  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  63:21  warning  Unexpected use of weak type "any"     flowtype/no-weak-types
  67:26  warning  Unexpected use of weak type "any"     flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/redux-devtools-extension_v2.x.x/test_redux-devtools-extension_v2.x.x.js
  69:21  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  70:26  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/redux-form_v5.x.x/test_redux-form_v5.js
  19:25  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  20:20  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  21:21  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
  33:32  warning  Unexpected use of weak type "any"       flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/rxjs_v5.0.x/test_rxjs.js
  145:56  warning  Unexpected use of weak type "any"  flowtype/no-weak-types
  146:52  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/sinon_v2.x.x/test_sinon_v2.x.x.js
    4:19  warning  Unexpected use of weak type "Function"  flowtype/no-weak-types
    6:20  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
   57:22  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
   58:18  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  166:16  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  175:16  warning  Unexpected use of weak type "any"       flowtype/no-weak-types
  185:16  warning  Unexpected use of weak type "any"       flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/twit_v2.x.x/test_twit_v2.x.x.js
  16:30  warning  Unexpected use of weak type "any"  flowtype/no-weak-types
  17:29  warning  Unexpected use of weak type "any"  flowtype/no-weak-types

/path/to/dir/flowtype/flow-typed/definitions/npm/underscore_v1.x.x/test_underscore-v1.js
  171:20  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types
  172:13  warning  Unexpected use of weak type "Object"  flowtype/no-weak-types

✖ 93 problems (0 errors, 93 warnings)

npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.

> flow-typed@2.1.5 prepublish /path/to/dir/flowtype/flow-typed/cli
> mkdirp dist && npm run test


> flow-typed@2.1.5 test /path/to/dir/flowtype/flow-typed/cli
> npm run clean && npm run build && npm run test-quick


> flow-typed@2.1.5 clean /path/to/dir/flowtype/flow-typed/cli
> rimraf dist


> flow-typed@2.1.5 build /path/to/dir/flowtype/flow-typed/cli
> mkdirp dist && babel ./src --out-dir=./dist

src/cli.js -> dist/cli.js
src/commands/__tests__/install-test.js -> dist/commands/__tests__/install-test.js
src/commands/__tests__/search-test.js -> dist/commands/__tests__/search-test.js
src/commands/create-stub.js -> dist/commands/create-stub.js
src/commands/install.js -> dist/commands/install.js
src/commands/runTests.js -> dist/commands/runTests.js
src/commands/search.js -> dist/commands/search.js
src/commands/update-cache.js -> dist/commands/update-cache.js
src/commands/update.js -> dist/commands/update.js
src/commands/validateDefs.js -> dist/commands/validateDefs.js
src/commands/version.js -> dist/commands/version.js
src/lib/TEST_UTILS.js -> dist/lib/TEST_UTILS.js
src/lib/__mocks__/node.js -> dist/lib/__mocks__/node.js
src/lib/__tests__/cacheRepoUtils-test.js -> dist/lib/__tests__/cacheRepoUtils-test.js
src/lib/__tests__/codeSign-test.js -> dist/lib/__tests__/codeSign-test.js
src/lib/__tests__/flowVersion-test.js -> dist/lib/__tests__/flowVersion-test.js
src/lib/__tests__/libDefs-test.js -> dist/lib/__tests__/libDefs-test.js
src/lib/__tests__/semver-test.js -> dist/lib/__tests__/semver-test.js
src/lib/cacheRepoUtils.js -> dist/lib/cacheRepoUtils.js
src/lib/codeSign.js -> dist/lib/codeSign.js
src/lib/fileUtils.js -> dist/lib/fileUtils.js
src/lib/flowProjectUtils.js -> dist/lib/flowProjectUtils.js
src/lib/flowVersion.js -> dist/lib/flowVersion.js
src/lib/git.js -> dist/lib/git.js
src/lib/github.js -> dist/lib/github.js
src/lib/isInFlowTypedRepo.js -> dist/lib/isInFlowTypedRepo.js
src/lib/libDefs.js -> dist/lib/libDefs.js
src/lib/node.js -> dist/lib/node.js
src/lib/npm/__tests__/npmLibDefs-test.js -> dist/lib/npm/__tests__/npmLibDefs-test.js
src/lib/npm/npmLibDefs.js -> dist/lib/npm/npmLibDefs.js
src/lib/npm/npmProjectUtils.js -> dist/lib/npm/npmProjectUtils.js
src/lib/semver.js -> dist/lib/semver.js
src/lib/stubUtils.js -> dist/lib/stubUtils.js
src/lib/validationErrors.js -> dist/lib/validationErrors.js

> flow-typed@2.1.5 test-quick /path/to/dir/flowtype/flow-typed/cli
> jest && npm run lint

 PASS  src/lib/npm/__tests__/npmLibDefs-test.js
 PASS  src/commands/__tests__/install-test.js
 PASS  src/lib/__tests__/libDefs-test.js
 PASS  src/commands/__tests__/search-test.js
 PASS  src/lib/__tests__/cacheRepoUtils-test.js
 PASS  src/lib/__tests__/flowVersion-test.js
 PASS  src/lib/__tests__/codeSign-test.js
 PASS  src/lib/__tests__/semver-test.js

Test Suites: 8 passed, 8 total
Tests:       94 passed, 94 total
Snapshots:   0 total
Time:        4.057s
Ran all test suites.

> flow-typed@2.1.5 lint /path/to/dir/flowtype/flow-typed/cli
> eslint .

up to date in 19.137s
All libdefs are named and structured correctly. (Found 317)
Running definition tests in /path/to/dir/flowtype/flow-typed/definitions/npm...

Fetching all Flow binaries...

All tests passed!

Am I missing something?

Environment information

  • Operation system: Mac OS 10.12.6
  • Flow version: 0.51.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
GAntoinecommented, Aug 2, 2017

I’m out of time tonight, but I’ll spend some time looking into this tomorrow. Could also just be that the github API is having issues at the moment, what with the downtime they suffered yesterday.

Thanks for digging into this so deeply! Keep updating this issue if you happen to find anything else, and I’ll do the same.

1reaction
stoufcommented, Aug 2, 2017

@GAntoine Sorry, I missed your message while I was typing mine.

Do try running this from flow-typed/src: npm run build && node dist/cli.js run-tests knex

I guess you meant from flow-typed/cli since the dist folder gets created in it?

I removed flow-typed/cli/dist folder before running the commands you gave me and the output is unfortunately the same 😦 Also, the observations I made in my previous comment applied there too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why You Shouldn't Trust a Test that Never Fails
The most obvious reason is that the test could be providing false negatives. This article seeks to answer why a test that never...
Read more >
Home pregnancy tests: Can you trust the results?
Many home pregnancy tests claim to be able to tell whether you're pregnant as early as the first day of a missed period....
Read more >
What To Do When Tests Fail? - TestProject
Test failures - how they impact our app quality, how to prevent them, what best practices exists to detect them ealy and fix...
Read more >
Detecting tests that will never fail
From time to time we stumble upon existing tests that will never fail: tests with missing assertions; tests that assert not what they...
Read more >
Have you ever failed a drug test?
Some companies will even go as far as reporting a failed test to authorities. Yes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found