Skip to content

Commit 5898a0f

Browse files
committed
Fix test CWD
1 parent 3a4698e commit 5898a0f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/helpers/__tests__/__snapshots__/getDtsSnapshot.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,9 @@ exports[`utils / cssSnapshots with goToDefinition enabled should return an objec
833833
"mappings": "AAAA;EACE,oBAAA;ACCF;;ADGE;EACE,oBAAA;ACAJ;;ADIA;EACE,oBAAA;ACDF;;ADKE;EACE,oBAAA;ACFJ;;ADOE;EACE,oBAAA;ACJJ;;ADME;EACE,oBAAA;ACJJ;;ADSE;EACE,oBAAA;ACNJ;;ADQE;EACE,oBAAA;ACNJ;;ADaE;EACE,oBAJI;ACNR;;ADSE;EACE,oBAJI;ACFR;;ADKE;EACE,oBAJI;ACER;;ADCE;EACE,oBAJI;ACMR;;ADHE;EACE,oBAJI;ACUR;;ADPE;EACE,oBAJI;ACcR;;ADXE;EACE,oBAJI;ACkBR;;ADfE;EACE,oBAJI;ACsBR;;ADnBE;EACE,oBAJI;AC0BR;;ADhBA;EE/CE,SFgDoB;ACmBtB;;ADhBA;EACE,cAAA;EACA,oBAAA;ACmBF;;ADhBA;EACE;IACE,2CAAA;ECmBF;AACF;;ADZA;;;;CAAA",
834834
"names": [],
835835
"sources": [
836-
"file:///Users/mrmckeb/Development/typescript-plugin-css-modules/src/helpers/__tests__/fixtures/test.module.scss",
836+
"file://[cwd]/src/helpers/__tests__/fixtures/test.module.scss",
837837
"src/helpers/__tests__/fixtures/test.module.scss",
838-
"file:///Users/mrmckeb/Development/typescript-plugin-css-modules/src/helpers/__tests__/fixtures/_mixin.scss",
838+
"file://[cwd]/src/helpers/__tests__/fixtures/_mixin.scss",
839839
],
840840
"version": 3,
841841
},

src/helpers/__tests__/getDtsSnapshot.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,12 @@ describe('utils / cssSnapshots', () => {
234234
});
235235

236236
it('should return an object with classes, css, and a source map', () => {
237+
if (cssExports.sourceMap?.sources) {
238+
const cwd = process.cwd();
239+
cssExports.sourceMap.sources = cssExports.sourceMap.sources.map((src) =>
240+
src.replace(cwd, '[cwd]'),
241+
);
242+
}
237243
expect(cssExports).toMatchSnapshot();
238244
});
239245

0 commit comments

Comments
 (0)