| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ import ENV from './helpers/env.js' | |||
| 5 | 5 | ||
| 6 | 6 | import cli from './helpers/cli.js' | |
| 7 | 7 | import read from './helpers/read.js' | |
| 8 | + import tmp from './helpers/tmp.js' | ||
| 8 | 9 | ||
| 9 | 10 | test('supports common config', async (t) => { | |
| 10 | 11 | const env = `module.exports = { | |
@@ -13,10 +14,10 @@ test('supports common config', async (t) => { | |||
| 13 | 14 | ] | |
| 14 | 15 | }` | |
| 15 | 16 | ||
| 16 | - const dir = await ENV(env, ['a.css']) | ||
| 17 | + const dir = await ENV(env, ['import.css', 'a.css']) | ||
| 17 | 18 | ||
| 18 | 19 | const { error, stderr } = await cli( | |
| 19 | - ['a.css', '-o', 'output.css', '--no-map'], | ||
| 20 | + ['import.css', '-o', 'output.css', '--no-map'], | ||
| 20 | 21 | dir, | |
| 21 | 22 | ) | |
| 22 | 23 | ||
@@ -38,10 +39,10 @@ test('supports ESM config', async (t) => { | |||
| 38 | 39 | } | |
| 39 | 40 | }` | |
| 40 | 41 | ||
| 41 | - const dir = await ENV(env, ['a.css'], 'mjs') | ||
| 42 | + const dir = await ENV(env, ['import.css', 'a.css'], 'mjs') | ||
| 42 | 43 | ||
| 43 | 44 | const { error, stderr } = await cli( | |
| 44 | - ['a.css', '-o', 'output.css', '--no-map'], | ||
| 45 | + ['import.css', '-o', 'output.css', '--no-map'], | ||
| 45 | 46 | dir, | |
| 46 | 47 | ) | |
| 47 | 48 | ||
@@ -100,3 +101,20 @@ test('errors if `from` is set', async (t) => { | |||
| 100 | 101 | /Config Error: Can not set from or to options in config file, use CLI arguments instead/, | |
| 101 | 102 | ) | |
| 102 | 103 | }) | |
| 104 | + | ||
| 105 | + test('supports --config flag', async (t) => { | ||
| 106 | + const output = tmp('output.css') | ||
| 107 | + | ||
| 108 | + const { error, stderr } = await cli([ | ||
| 109 | + 'test/fixtures/import.css', | ||
| 110 | + '-o', | ||
| 111 | + output, | ||
| 112 | + '--no-map', | ||
| 113 | + '--config', | ||
| 114 | + 'test/fixtures/cfg-dir', | ||
| 115 | + ]) | ||
| 116 | + | ||
| 117 | + t.falsy(error, stderr) | ||
| 118 | + | ||
| 119 | + t.is(await read(output), await read('test/fixtures/a.css')) | ||
| 120 | + }) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,6 @@ | |||
| 1 | + import postcssImport from 'postcss-import' | ||
| 2 | + export default function () { | ||
| 3 | + return { | ||
| 4 | + plugins: [postcssImport()], | ||
| 5 | + } | ||
| 6 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments