-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixes printing of a reason when it doesn't have clearName
Closes: #7
- Loading branch information
Showing
7 changed files
with
204 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"chunks": [ | ||
{ | ||
"modules": [ | ||
{ | ||
"id": "S33B", | ||
"identifier": | ||
"delegated 164 from dll-reference reactVendors_489ff309e47766c80b1e", | ||
"name": | ||
"delegated ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js from dll-reference reactVendors_489ff309e47766c80b1e", | ||
"index": 382, | ||
"index2": 380, | ||
"size": 42, | ||
"cacheable": true, | ||
"built": true, | ||
"optional": false, | ||
"prefetched": false, | ||
"chunks": [1], | ||
"assets": [], | ||
"issuer": | ||
"/Users/ssysoev/Development/temp/guillaumecisco/node_modules/happypack/loader.js?id=babel!/Users/ssysoev/Development/temp/guillaumecisco/src/client/index.js", | ||
"issuerId": "EAxn", | ||
"issuerName": "./src/client/index.js", | ||
"profile": { | ||
"factory": 12, | ||
"building": 0, | ||
"dependencies": 0 | ||
}, | ||
"failed": false, | ||
"errors": 0, | ||
"warnings": 0, | ||
"reasons": [ | ||
{ | ||
"moduleId": "EAxn", | ||
"moduleIdentifier": | ||
"/Users/ssysoev/Development/temp/guillaumecisco/node_modules/happypack/loader.js?id=babel!/Users/ssysoev/Development/temp/guillaumecisco/src/client/index.js", | ||
"module": "./src/client/index.js", | ||
"moduleName": "./src/client/index.js", | ||
"type": "cjs require", | ||
"userRequest": "react-tap-event-plugin", | ||
"loc": "17:27-60" | ||
} | ||
], | ||
"usedExports": true, | ||
"providedExports": null, | ||
"optimizationBailout": [ | ||
"ModuleConcatenation bailout: Module is not an ECMAScript module" | ||
], | ||
"depth": 2 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Snapshot report for `lib/__tests__/print.js` | ||
|
||
The actual snapshot is saved in `print.js.snap`. | ||
|
||
Generated by [AVA](https://ava.li). | ||
|
||
## should properly print reasons without clearName | ||
|
||
> Snapshot 1 | ||
[ | ||
'', | ||
` MODULE react-tap-event-plugin␊ | ||
├─ imported: 1 time␊ | ||
├─ type: [direct]␊ | ||
├─ locations: ␊ | ||
│ └─ delegated ./node_modules/react-tap-event-plugin/␊ | ||
│ ␊ | ||
├─ files: ␊ | ||
│ └─ delegated ./node_modules/react-tap-event-plugin/src/injectTapEventPlugin.js from dll-reference reactVendors_489ff309e47766c80b1e␊ | ||
│ ␊ | ||
└─ reasons:␊ | ||
└─ ./src/client/index.js 17:27-60 [cjs require]␊ | ||
`, | ||
'--------------------', | ||
'', | ||
'', | ||
] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const stripAnsi = require("strip-ansi"); | ||
const test = require("ava"); | ||
const fixtures = require("fixturez"); | ||
const f = fixtures(__dirname); | ||
const getStats = require("../get-stats"); | ||
const analyze = require("../analyze"); | ||
const print = require("../print"); | ||
|
||
const createPrint = () => { | ||
const messages = []; | ||
return msg => { | ||
messages.push(stripAnsi(msg) || ""); | ||
return messages; | ||
}; | ||
}; | ||
|
||
test("should properly print reasons without clearName", t => { | ||
const stats = analyze(getStats(f.find("with-external.json"))); | ||
const logger = createPrint(); | ||
print(stats, {}, 0, logger); | ||
t.snapshot(logger()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters