2017-02-22 00:59:19 +03:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
2018-07-03 09:06:29 +03:00
|
|
|
exports[`test.js - flow-verify 1`] = `
|
2017-04-12 23:41:51 +03:00
|
|
|
/**
|
2016-12-23 22:31:38 +03:00
|
|
|
* Test resolution precedence in node:
|
|
|
|
* checked module > lib def > unchecked module
|
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
// node_modules/buffer/index.js is unchecked,
|
2017-02-22 00:59:19 +03:00
|
|
|
// so we shouldn't pick up its boolean redefinition of INSPECT_MAX_BYTES
|
2016-12-23 22:31:38 +03:00
|
|
|
//
|
2017-04-12 23:41:51 +03:00
|
|
|
var buffer = require("buffer");
|
2016-12-23 22:31:38 +03:00
|
|
|
var b: boolean = buffer.INSPECT_MAX_BYTES; // error, number ~/> boolean
|
|
|
|
|
|
|
|
// node_modules/crypto/index.js is checked,
|
|
|
|
// so we should pick up its boolean redefinition of DEFAULT_ENCODING
|
|
|
|
//
|
2017-04-12 23:41:51 +03:00
|
|
|
var crypto = require("crypto");
|
2017-02-22 00:59:19 +03:00
|
|
|
var b: boolean = crypto.DEFAULT_ENCODING; // no error, we've overridden
|
2016-12-23 22:31:38 +03:00
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
// names that are explicit paths shouldn't fall back to lib defs
|
2016-12-23 22:31:38 +03:00
|
|
|
//
|
2017-04-12 23:41:51 +03:00
|
|
|
var buffer2 = require("./buffer");
|
2016-12-23 22:31:38 +03:00
|
|
|
var x2: string = buffer2.INSPECT_MAX_BYTES; // error, module not found
|
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
var buffer3 = require("./buffer.js");
|
2016-12-23 22:31:38 +03:00
|
|
|
var x3: string = buffer3.INSPECT_MAX_BYTES; // error, module not found
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
/**
|
|
|
|
* Test resolution precedence in node:
|
|
|
|
* checked module > lib def > unchecked module
|
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
*/
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
// node_modules/buffer/index.js is unchecked,
|
2017-02-22 00:59:19 +03:00
|
|
|
// so we shouldn't pick up its boolean redefinition of INSPECT_MAX_BYTES
|
2016-12-23 22:31:38 +03:00
|
|
|
//
|
2017-04-12 23:41:51 +03:00
|
|
|
var buffer = require("buffer");
|
2017-01-26 22:57:43 +03:00
|
|
|
var b: boolean = buffer.INSPECT_MAX_BYTES; // error, number ~/> boolean
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
// node_modules/crypto/index.js is checked,
|
|
|
|
// so we should pick up its boolean redefinition of DEFAULT_ENCODING
|
|
|
|
//
|
2017-04-12 23:41:51 +03:00
|
|
|
var crypto = require("crypto");
|
2017-02-22 00:59:19 +03:00
|
|
|
var b: boolean = crypto.DEFAULT_ENCODING; // no error, we've overridden
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-02-22 00:59:19 +03:00
|
|
|
// names that are explicit paths shouldn't fall back to lib defs
|
2016-12-23 22:31:38 +03:00
|
|
|
//
|
2017-04-12 23:41:51 +03:00
|
|
|
var buffer2 = require("./buffer");
|
2017-01-26 22:57:43 +03:00
|
|
|
var x2: string = buffer2.INSPECT_MAX_BYTES; // error, module not found
|
2017-01-31 19:27:44 +03:00
|
|
|
|
2017-04-12 23:41:51 +03:00
|
|
|
var buffer3 = require("./buffer.js");
|
2017-01-11 18:16:38 +03:00
|
|
|
var x3: string = buffer3.INSPECT_MAX_BYTES; // error, module not found
|
2017-04-12 23:41:51 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
`;
|