GeezerVison is showing github.com — test,module: add test for exports cjs loader check · nodejs/node@ad4af04
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/fixtures/bluebird/node_modules/bluebird/js/release/bluebird.js Collapse file Copy file name to clipboardExpand all lines: test/fixtures/bluebird/node_modules/bluebird/package.json +78Lines changed: 78 additions & 0 deletions Collapse file Copy file name to clipboard +78Lines changed: 78 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +{ | | 2 | + "name": "bluebird", | | 3 | + "description": "Full featured Promises/A+ implementation with exceptionally good performance", | | 4 | + "version": "3.7.2", | | 5 | + "keywords": [ | | 6 | + "promise", | | 7 | + "performance", | | 8 | + "promises", | | 9 | + "promises-a", | | 10 | + "promises-aplus", | | 11 | + "async", | | 12 | + "await", | | 13 | + "deferred", | | 14 | + "deferreds", | | 15 | + "future", | | 16 | + "flow control", | | 17 | + "dsl", | | 18 | + "fluent interface" | | 19 | + ], | | 20 | + "scripts": { | | 21 | + "lint": "node scripts/jshint.js", | | 22 | + "test": "node --expose-gc tools/test.js", | | 23 | + "istanbul": "istanbul", | | 24 | + "prepublish": "npm run generate-browser-core && npm run generate-browser-full", | | 25 | + "generate-browser-full": "node tools/build.js --no-clean --no-debug --release --browser --minify", | | 26 | + "generate-browser-core": "node tools/build.js --features=core --no-debug --release --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js" | | 27 | + }, | | 28 | + "homepage": "https://github.com/petkaantonov/bluebird", | | 29 | + "repository": { | | 30 | + "type": "git", | | 31 | + "url": "git://github.com/petkaantonov/bluebird.git" | | 32 | + }, | | 33 | + "bugs": { | | 34 | + "url": "http://github.com/petkaantonov/bluebird/issues" | | 35 | + }, | | 36 | + "license": "MIT", | | 37 | + "author": { | | 38 | + "name": "Petka Antonov", | | 39 | + | | 40 | + "url": "http://github.com/petkaantonov/" | | 41 | + }, | | 42 | + "devDependencies": { | | 43 | + "acorn": "^6.0.2", | | 44 | + "acorn-walk": "^6.1.0", | | 45 | + "baconjs": "^0.7.43", | | 46 | + "bluebird": "^2.9.2", | | 47 | + "body-parser": "^1.10.2", | | 48 | + "browserify": "^8.1.1", | | 49 | + "cli-table": "~0.3.1", | | 50 | + "co": "^4.2.0", | | 51 | + "cross-spawn": "^0.2.3", | | 52 | + "glob": "^4.3.2", | | 53 | + "grunt-saucelabs": "~8.4.1", | | 54 | + "highland": "^2.3.0", | | 55 | + "istanbul": "^0.3.5", | | 56 | + "jshint": "^2.6.0", | | 57 | + "jshint-stylish": "~0.2.0", | | 58 | + "kefir": "^2.4.1", | | 59 | + "mkdirp": "~0.5.0", | | 60 | + "mocha": "~2.1", | | 61 | + "open": "~0.0.5", | | 62 | + "optimist": "~0.6.1", | | 63 | + "rimraf": "~2.2.6", | | 64 | + "rx": "^2.3.25", | | 65 | + "serve-static": "^1.7.1", | | 66 | + "sinon": "~1.7.3", | | 67 | + "uglify-js": "~2.4.16" | | 68 | + }, | | 69 | + "readmeFilename": "README.md", | | 70 | + "main": "./js/release/bluebird.js", | | 71 | + "webpack": "./js/release/bluebird.js", | | 72 | + "browser": "./js/browser/bluebird.js", | | 73 | + "files": [ | | 74 | + "js/browser", | | 75 | + "js/release", | | 76 | + "LICENSE" | | 77 | + ] | | 78 | +} |
Collapse file Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +require('bluebird') |
Collapse file Copy file name to clipboard +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +'use strict'; | | 2 | + | | 3 | +require('../common'); | | 4 | + | | 5 | +// Test that a nonexistent "main" entry in a package.json that also omits an | | 6 | +// "exports" entry will be ignored if it can be found in node_modules instead | | 7 | +// rather than throwing. | | 8 | +// | | 9 | +// Throwing is perhaps "correct" behavior, but it will break bluebird tests | | 10 | +// as of this writing. | | 11 | + | | 12 | +const assert = require('assert'); | | 13 | +const { spawnSync } = require('child_process'); | | 14 | +const fixtures = require('../common/fixtures'); | | 15 | + | | 16 | +const { error, status, stderr } = | | 17 | + spawnSync(process.execPath, [fixtures.path('bluebird', 'test.js')]); | | 18 | + | | 19 | +assert.ifError(error); | | 20 | +assert.strictEqual(status, 0, stderr); |
|