Skip to content

Commit 8a0075c

Browse files
committed
fix: use source in webpack tests
1 parent a27ac76 commit 8a0075c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app-config-webpack/src/index.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('frontend-webpack-project example', () => {
3333
if (!stats) return reject(new Error('no stats'));
3434
if (stats.hasErrors()) reject(stats.toString());
3535

36-
const { children } = stats.toJson();
36+
const { children } = stats.toJson({ source: true });
3737
const [{ modules = [] }] = children || [];
3838

3939
expect(
@@ -56,7 +56,7 @@ describe('frontend-webpack-project example', () => {
5656
if (!stats) return reject(new Error('no stats'));
5757
if (stats.hasErrors()) reject(stats.toString());
5858

59-
const { children } = stats.toJson();
59+
const { children } = stats.toJson({ source: true });
6060
const [{ modules = [] }] = children || [];
6161

6262
expect(
@@ -79,7 +79,7 @@ describe('frontend-webpack-project example', () => {
7979
if (!stats) return reject(new Error('no stats'));
8080
if (stats.hasErrors()) reject(stats.toString());
8181

82-
const { children } = stats.toJson();
82+
const { children } = stats.toJson({ source: true });
8383
const [{ modules = [] }] = children || [];
8484

8585
expect(
@@ -104,7 +104,7 @@ describe('frontend-webpack-project example', () => {
104104
if (!stats) return reject(new Error('no stats'));
105105
if (stats.hasErrors()) reject(stats.toString());
106106

107-
const { children } = stats.toJson();
107+
const { children } = stats.toJson({ source: true });
108108
const [{ modules = [] }] = children || [];
109109

110110
expect(
@@ -145,7 +145,7 @@ describe('frontend-webpack-project example', () => {
145145
if (!stats) return reject(new Error('no stats'));
146146
if (stats.hasErrors()) reject(stats.toString());
147147

148-
const { children } = stats.toJson();
148+
const { children } = stats.toJson({ source: true });
149149
const [{ modules = [] }] = children || [];
150150

151151
expect(
@@ -169,9 +169,10 @@ describe('frontend-webpack-project example', () => {
169169
if (!stats) return reject(new Error('no stats'));
170170
if (stats.hasErrors()) reject(stats.toString());
171171

172-
const { children } = stats.toJson();
172+
const { children } = stats.toJson({ source: true });
173173
const [{ modules = [] }] = children || [];
174174

175+
console.log(modules.map(m => m.source))
175176
expect(modules.some(({ source }) => source?.includes('validateConfig'))).toBe(false);
176177

177178
done();

0 commit comments

Comments
 (0)