Commit a370485 1 parent 459dd22 commit a370485 Copy full SHA for a370485
File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' )
1
2
const { execSync } = require ( 'child_process' )
2
3
const os = require ( 'os' )
3
4
const fs = require ( 'fs-extra' )
@@ -34,11 +35,16 @@ it('supports first-party plugins', () => {
34
35
35
36
it ( 'supports postcss config files' , async ( ) => {
36
37
// We have to run this test outside of any place with node_modules for it to properly test this situation
37
- let result = await inIsolatedContext ( ( ) => {
38
+ let result = await inIsolatedContext ( ( base ) => {
38
39
// Emulate the user adding their own postcss plugins
39
40
execSync ( `npm install postcss-will-change` )
40
41
41
- return exec ( '--content tests/fixtures/basic.html --postcss tests/fixtures/postcss.config.js' )
42
+ return exec (
43
+ `--content ${ path . resolve ( base , 'tests/fixtures/basic.html' ) } --postcss ${ path . resolve (
44
+ base ,
45
+ 'tests/fixtures/postcss.config.js'
46
+ ) } `
47
+ )
42
48
} )
43
49
44
50
expect ( result ) . toContain ( '.uppercase' )
@@ -51,7 +57,7 @@ it('supports postcss config files', async () => {
51
57
/**
52
58
* @template T
53
59
* @param {() => T } fn
54
- * @returns {T }
60
+ * @returns {Promise<T> }
55
61
*/
56
62
async function inIsolatedContext ( fn ) {
57
63
// Create a new directory entirely outside of the package for the test
@@ -73,7 +79,7 @@ async function inIsolatedContext(fn) {
73
79
process . chdir ( dest )
74
80
75
81
try {
76
- return await fn ( )
82
+ return await fn ( dest )
77
83
} finally {
78
84
// Change back to the original working directory
79
85
process . chdir ( __dirname )
You can’t perform that action at this time.
0 commit comments