Closed adierkens closed 7 years ago
% npm test on no-modules|…
> babel-plugin-transform-postcss@0.1.1 test /Users/adierkens/Developer/babel-plugin-transform-postcss
> eslint . && flow check && BABEL_ENV=coverage nyc mocha
Found 0 errors
babel-plugin-transform-postcss
when transforming require.js
✓ launches the server
✓ launches a client
✓ compiles correctly
when transforming require.js
✓ does not launch the server again
when transforming import.js
✓ launches the server
✓ launches a client
✓ compiles correctly
when transforming require.js
✓ does not launch the server again
when transforming nocss.js
✓ does not launch the server
✓ does not launch a client
when transforming import.no.name.js
✓ does not launch the server
✓ does not launch a client
when transforming import.nocss.js
✓ does not launch the server
✓ does not launch a client
when transforming import.js without modules
✓ launches the server
✓ launches a client
✓ compiles correctly
when transforming require.js
✓ does not launch the server again
when the server has been started started
when transforming require.js
✓ does not launch the server again
when transforming require.js & the client returns no data
✓ compiles correctly
postcss-client
with a server to connect to
main(...testArgs)
✓ sends client message to server
✓ writes server response to stdout
✓ succeeds during first connect attempt
main(...testArgs)
✓ attempts to re-connect
postcss-server
main(...testArgs)
✓ starts a server
✓ observes SIGINT to cleanup server socket
✓ accepts JSON details and extracts PostCSS modules (242ms)
✓ fails gracefully for invalid CSS
with a cached result
✓ accepts JSON details and extracts PostCSS modules
with an invalid cache
✓ does not contain a response
✓ logs a useful message
with a missing CSS file
✓ does not contain a response
✓ logs a useful message
with a missing config file
✓ does not contain a response
✓ logs a useful message
when listen fails
✓ fails to complete main(...testArgs)
when the server socket already exists
main(...testArgs)
✓ exits
✓ logs a useful message
when stderr is a TTY
main(...testArgs)
✓ logs with color
when making a directory fails
✓ errors when invoking main
40 passing (452ms)
-------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-------------------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
plugin.js | 100 | 100 | 100 | 100 | |
postcss-client.js | 100 | 100 | 100 | 100 | |
postcss-server.js | 100 | 100 | 100 | 100 | |
-------------------|----------|----------|----------|----------|----------------|
Not sure what's up with the travis build. Tests run fine locally.
Any word on when this will get merged in? Having this support will be incredibly helpful!
@wbyoung Thanks for reviewing! I made the changes you requested
Just released in 0.2.1.
With growing support for
module
builds of components (from rollup and webpack), there's a need to transform postcss without transformingimport
statements torequire
ones.This adds support for the
{ modules: false }
babel-config option, which skips transformingimport
statements torequire
'sFixes #27