Skip to content

Commit 058590a

Browse files
committed
Add more tests for StatsSerializeStream
1 parent 6ad1857 commit 058590a

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"eslint-config-th0r-react": "2.0.1",
7373
"eslint-plugin-react": "7.21.5",
7474
"exports-loader": "1.1.1",
75+
"globby": "11.0.1",
7576
"gulp": "4.0.2",
7677
"gulp-babel": "8.0.0",
7778
"mobx": "5.15.7",

test/statsUtils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
const path = require('path');
2+
const {readFileSync} = require('fs');
3+
const globby = require('globby');
4+
15
const {StatsSerializeStream} = require('../lib/statsUtils');
26

37
describe('StatsSerializeStream', () => {
@@ -46,6 +50,14 @@ describe('StatsSerializeStream', () => {
4650
}
4751
});
4852
});
53+
54+
globby.sync('stats/**/*.json', {cwd: __dirname}).forEach(filepath => {
55+
it(`should properly stringify JSON from "${filepath}"`, function () {
56+
const content = readFileSync(path.resolve(__dirname, filepath), 'utf8');
57+
const json = JSON.parse(content);
58+
expectProperJson(json);
59+
});
60+
});
4961
});
5062

5163
async function expectProperJson(json) {

0 commit comments

Comments
 (0)