@@ -17,7 +17,7 @@ for (const object of [
17
17
{ type : 'tests' , rel : 'tests-dir' , dir : 'tests/snapshots' }
18
18
] ) {
19
19
test ( `snapshots work (${ object . type } )` , t => {
20
- const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , object . rel , object . dir , 'test.js .snap' ) ;
20
+ const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , object . rel , object . dir , 'test.cjs .snap' ) ;
21
21
try {
22
22
fs . unlinkSync ( snapPath ) ;
23
23
} catch ( error ) {
@@ -78,7 +78,7 @@ test('two', t => {
78
78
} ) ;
79
79
80
80
test ( 'outdated snapshot version is reported to the console' , t => {
81
- const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.js .snap' ) ;
81
+ const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.cjs .snap' ) ;
82
82
fs . writeFileSync ( snapPath , Buffer . from ( [ 0x0A , 0x00 , 0x00 ] ) ) ;
83
83
84
84
execCli ( [ 'test.cjs' ] , { dirname : 'fixture/snapshots' } , ( error , stdout ) => {
@@ -92,7 +92,7 @@ test('outdated snapshot version is reported to the console', t => {
92
92
} ) ;
93
93
94
94
test ( 'outdated snapshot version can be updated' , t => {
95
- const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.js .snap' ) ;
95
+ const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.cjs .snap' ) ;
96
96
fs . writeFileSync ( snapPath , Buffer . from ( [ 0x0A , 0x00 , 0x00 ] ) ) ;
97
97
98
98
execCli ( [ 'test.cjs' , '--update-snapshots' ] , { dirname : 'fixture/snapshots' , env : { AVA_FORCE_CI : 'not-ci' } } , ( error , stdout ) => {
@@ -103,7 +103,7 @@ test('outdated snapshot version can be updated', t => {
103
103
} ) ;
104
104
105
105
test ( 'newer snapshot version is reported to the console' , t => {
106
- const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.js .snap' ) ;
106
+ const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.cjs .snap' ) ;
107
107
fs . writeFileSync ( snapPath , Buffer . from ( [ 0x0A , 0xFF , 0xFF ] ) ) ;
108
108
109
109
execCli ( [ 'test.cjs' ] , { dirname : 'fixture/snapshots' } , ( error , stdout ) => {
@@ -117,7 +117,7 @@ test('newer snapshot version is reported to the console', t => {
117
117
} ) ;
118
118
119
119
test ( 'snapshot corruption is reported to the console' , t => {
120
- const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.js .snap' ) ;
120
+ const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.cjs .snap' ) ;
121
121
fs . writeFileSync ( snapPath , Buffer . from ( [ 0x0A , 0x03 , 0x00 ] ) ) ;
122
122
123
123
execCli ( [ 'test.cjs' ] , { dirname : 'fixture/snapshots' } , ( error , stdout ) => {
@@ -131,7 +131,7 @@ test('snapshot corruption is reported to the console', t => {
131
131
} ) ;
132
132
133
133
test ( 'legacy snapshot files are reported to the console' , t => {
134
- const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.js .snap' ) ;
134
+ const snapPath = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test.cjs .snap' ) ;
135
135
fs . writeFileSync ( snapPath , Buffer . from ( '// Jest Snapshot v1, https://goo.gl/fbAQLP\n' ) ) ;
136
136
137
137
execCli ( [ 'test.cjs' ] , { dirname : 'fixture/snapshots' } , ( error , stdout ) => {
@@ -203,8 +203,8 @@ test('snapshots resolved location from "snapshotDir" in AVA config', t => {
203
203
. map ( snapRelativeDir => {
204
204
const snapPath = path . join ( __dirname , '..' , relativeFixtureDir , snapDir , snapRelativeDir ) ;
205
205
return [
206
- path . join ( snapPath , 'test.js .md' ) ,
207
- path . join ( snapPath , 'test.js .snap' )
206
+ path . join ( snapPath , 'test.cjs .md' ) ,
207
+ path . join ( snapPath , 'test.cjs .snap' )
208
208
] ;
209
209
} )
210
210
. reduce ( ( a , b ) => [ ...a , ...b ] , [ ] ) ;
@@ -278,8 +278,8 @@ test('snapshots are identical on different platforms', t => {
278
278
279
279
test ( 'in CI, new snapshots are not recorded' , t => {
280
280
const fixtureDir = path . join ( __dirname , '..' , 'fixture' , 'snapshots' , 'test-content' ) ;
281
- const reportPath = path . join ( fixtureDir , 'tests' , 'snapshots' , 'test.js .md' ) ;
282
- const snapPath = path . join ( fixtureDir , 'tests' , 'snapshots' , 'test.js .snap' ) ;
281
+ const reportPath = path . join ( fixtureDir , 'tests' , 'snapshots' , 'test.cjs .md' ) ;
282
+ const snapPath = path . join ( fixtureDir , 'tests' , 'snapshots' , 'test.cjs .snap' ) ;
283
283
284
284
const removeFile = filePath => {
285
285
try {
0 commit comments