-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: import cache * chore: add test for import cache & config search error * chore: update describe name * chore: search ghost dir * chore: remove .href of pathToFileURL --------- Co-authored-by: pengbo43 <pengbo43@jd.com>
- Loading branch information
1 parent
2c42a73
commit 3ade20e
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const { describe, test } = require('node:test') | ||
const { equal } = require('node:assert') | ||
const { writeFileSync } = require('node:fs') | ||
const postcssrc = require('../src/index.js') | ||
|
||
describe('.postcss.config.js Load Config', () => { | ||
test('.postcss.config.js config update cache', () => { | ||
|
||
return postcssrc({}, 'test').then(config => { | ||
let { file, options } = config | ||
equal(options.map, false) | ||
writeFileSync(file, `export default ${JSON.stringify({ map: true })}`) | ||
postcssrc({}, 'test').then(({ options: newOptions }) => { | ||
equal(newOptions.map, true) | ||
}).finally(() => { | ||
writeFileSync(file, `export default ${JSON.stringify({ map: false })}`) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {"map":false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters