Skip to content

Shallow copy options object #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function css(css, file) {
return rc(ctx, argv.config)
.then(config => {
config = config || cliConfig
const options = config.options
const options = Object.assign({}, config.options)

if (file === 'stdin' && output) file = output

Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/glob/a.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.a {
color: red;
}
3 changes: 3 additions & 0 deletions test/fixtures/glob/b.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.b {
color: blue;
}
3 changes: 3 additions & 0 deletions test/fixtures/glob/s.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.a {
color: red
}
32 changes: 32 additions & 0 deletions test/glob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import test from 'ava'
import path from 'path'

import cli from './helpers/cli.js'
import tmp from './helpers/tmp.js'
import read from './helpers/read.js'

test('works with glob patterns', async t => {
const output = tmp()

const { error, stderr } = await cli([
'test/fixtures/glob/*.css',
'-d',
output,
'--no-map'
])

t.ifError(error, stderr)

t.is(
await read(path.join(output, 'a.css')),
await read('test/fixtures/glob/a.css')
)
t.is(
await read(path.join(output, 'b.css')),
await read('test/fixtures/glob/b.css')
)
t.is(
await read(path.join(output, 's.css')),
await read('test/fixtures/glob/s.css')
)
})