-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,034 additions
and
203 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,5 @@ yarn.lock | |
build/ | ||
test/ | ||
.travis.yml | ||
.eslintrc | ||
|
||
gulpfile.js |
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
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
var expect = require('chai').expect; | ||
|
||
describe('custom parser', function () { | ||
|
||
it('processes sugarss', function () { | ||
var css = require('!raw-loader!../!' + | ||
'./cases/sugar.css'); | ||
expect(css).to.eql('a\n color: rgba(255, 0, 0, 0.1)\n'); | ||
expect(css).toEqual('a\n color: rgba(255, 0, 0, 0.1)\n'); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,60 +1,58 @@ | ||
var expect = require('chai').expect; | ||
|
||
describe('default', function () { | ||
|
||
it('processes CSS with default plugins', function () { | ||
var css = require('!raw-loader!../!./cases/style.css'); | ||
expect(css).to.eql('a { color: blue }\n'); | ||
expect(css).toEqual('a { color: blue }\n'); | ||
}); | ||
|
||
it('overrides default config by subdir config', function () { | ||
var css = require('!raw-loader!../!./cases/config/style.css'); | ||
expect(css).to.eql('a { color: black }\n'); | ||
expect(css).toEqual('a { color: black }\n'); | ||
}); | ||
|
||
it('send webpack instance to config', function () { | ||
var css = require('!raw-loader!../!./cases/env/style.css'); | ||
expect(css).to.eql('a::before { content: "style.css" }\n'); | ||
expect(css).toEqual('a::before { content: "style.css" }\n'); | ||
}); | ||
|
||
it('processes CSS in safe mode', function () { | ||
var css = require('!raw-loader' + | ||
'!../?parser=postcss-safe-parser' + | ||
'!./cases/broken.css'); | ||
expect(css).to.eql('a { color:\n}'); | ||
expect(css).toEqual('a { color:\n}'); | ||
}); | ||
|
||
it('lets other plugins alter the used plugins', function () { | ||
var css = require('!raw-loader!../?rewrite=true' + | ||
'!./cases/style.css'); | ||
expect(css).to.eql('a { color: black }\n'); | ||
expect(css).toEqual('a { color: black }\n'); | ||
}); | ||
|
||
it('processes CSS-in-JS', function () { | ||
var css = require('!raw-loader' + | ||
'!../?parser=postcss-js' + | ||
'!./cases/style.js'); | ||
expect(css).to.eql('a {\n color: blue\n}'); | ||
expect(css).toEqual('a {\n color: blue\n}'); | ||
}); | ||
|
||
it('processes CSS with exec', function () { | ||
var css = require('!raw-loader' + | ||
'!../?exec' + | ||
'!./cases/exec.js'); | ||
expect(css).to.eql('a {\n color: green\n}'); | ||
expect(css).toEqual('a {\n color: green\n}'); | ||
}); | ||
|
||
it('inlines map', function () { | ||
var css = require('!raw-loader!../?sourceMap=inline' + | ||
'!./cases/style.css'); | ||
expect(css).to.include('/*# sourceMappingURL='); | ||
expect(css).toContain('/*# sourceMappingURL='); | ||
}); | ||
|
||
it('allows to change config path', function () { | ||
var css = require('!raw-loader' + | ||
'!../?config=test/cases/config/postcss.config.js' + | ||
'!./cases/style.css'); | ||
expect(css).to.eql('a { color: black }\n'); | ||
expect(css).toEqual('a { color: black }\n'); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
var expect = require('chai').expect; | ||
|
||
describe('explicit plugins', function () { | ||
|
||
it('processes CSS with custom plugins', function () { | ||
var css = require('!raw-loader!../!' + | ||
'./cases/style.css'); | ||
expect(css).to.eql('a { color: rgba(255, 0, 0, 0.1) }\n'); | ||
expect(css).toEqual('a { color: rgba(255, 0, 0, 0.1) }\n'); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
var expect = require('chai').expect; | ||
|
||
describe('with packs', function () { | ||
|
||
it('processes CSS with default plugins', function () { | ||
var css = require('!raw-loader!../!' + | ||
'./cases/style.css'); | ||
expect(css).to.eql('a { color: rgba(255, 0, 0, 0.1) }\n'); | ||
expect(css).toEqual('a { color: rgba(255, 0, 0, 0.1) }\n'); | ||
}); | ||
|
||
it('processes CSS with custom plugins', function () { | ||
var css = require('!raw-loader!../?pack=blues!' + | ||
'./cases/style.css'); | ||
expect(css).to.eql('a { color: blue }\n'); | ||
expect(css).toEqual('a { color: blue }\n'); | ||
}); | ||
|
||
}); |
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
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
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
Oops, something went wrong.