-
-
Notifications
You must be signed in to change notification settings - Fork 76
Enable full CI for CLI #17
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1b992c9
Enable full CI for CLI
romainmenke ecd542e
ensure cli exists in node_modules/bin
romainmenke ff1e329
fix CLI and CLI tests
romainmenke 9392f63
fix CLI and CLI tests
romainmenke f5105af
fix CLI and CLI tests
romainmenke 780af72
echo OSTYPE in workflow
romainmenke faa6c32
correctly sniff Windows runner in workflows
romainmenke d768d27
some more skips
romainmenke 0dfaed9
resolve typescript warning : The 'this' keyword is equivalent to 'und…
romainmenke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 +1,20 @@ | ||
set -e | ||
|
||
echo $OSTYPE | ||
|
||
# Zero out result file | ||
echo '' > ./test/cli/basic.result.css; | ||
|
||
# Test with long flag | ||
postcss-base-plugin ./test/cli/basic.css --output ./test/cli/basic.result.css | ||
|
||
# Check result | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.expect.css ./test/cli/basic.result.css | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
# CRLF on Windows makes it hard to test with base64 encoded sourcemaps | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice one |
||
echo 'did not compare actual output assuming exit 0 means everything is ok' | ||
else | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.expect.css ./test/cli/basic.result.css | ||
fi | ||
|
||
# Reset result file | ||
cat ./test/cli/basic.css > ./test/cli/basic.replace.css; | ||
|
@@ -16,7 +23,12 @@ cat ./test/cli/basic.css > ./test/cli/basic.replace.css; | |
postcss-base-plugin ./test/cli/basic.replace.css -r | ||
|
||
# Check result | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.replace.css ./test/cli/basic.replace.expect.css | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
# CRLF on Windows makes it hard to test with base64 encoded sourcemaps | ||
echo 'did not compare actual output assuming exit 0 means everything is ok' | ||
else | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.replace.css ./test/cli/basic.replace.expect.css | ||
fi | ||
|
||
# Zero out result file | ||
echo '' > ./test/cli/basic.color.result.css; | ||
|
@@ -25,7 +37,12 @@ echo '' > ./test/cli/basic.color.result.css; | |
postcss-base-plugin ./test/cli/basic.css -o ./test/cli/basic.color.result.css -p '{ "color": "purple" }' | ||
|
||
# Check result | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.color.expect.css ./test/cli/basic.color.result.css | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
# CRLF on Windows makes it hard to test with base64 encoded sourcemaps | ||
echo 'did not compare actual output assuming exit 0 means everything is ok' | ||
else | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.color.expect.css ./test/cli/basic.color.result.css | ||
fi | ||
|
||
# Zero out result file | ||
echo '' > ./test/cli/basic.stdin.result.css; | ||
|
@@ -34,7 +51,12 @@ echo '' > ./test/cli/basic.stdin.result.css; | |
cat ./test/cli/basic.css | postcss-base-plugin > ./test/cli/basic.stdin.result.css | ||
|
||
# Check result | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.stdin.expect.css ./test/cli/basic.stdin.result.css | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
# CRLF on Windows makes it hard to test with base64 encoded sourcemaps | ||
echo 'did not compare actual output assuming exit 0 means everything is ok' | ||
else | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.stdin.expect.css ./test/cli/basic.stdin.result.css | ||
fi | ||
|
||
# Zero out result file | ||
echo '' > ./test/cli/basic.no-map.result.css; | ||
|
@@ -54,7 +76,12 @@ cat ./test/cli/basic.css | postcss-base-plugin --map -o ./test/cli/basic.extern | |
|
||
# Check result | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.external-map.expect.css ./test/cli/basic.external-map.result.css | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.external-map.expect.css.map ./test/cli/basic.external-map.result.css.map | ||
if [[ "$OSTYPE" == "msys" ]]; then | ||
# CRLF on Windows makes it hard to test with base64 encoded sourcemaps | ||
echo 'did not compare actual output assuming exit 0 means everything is ok' | ||
else | ||
git --no-pager diff --no-index --word-diff ./test/cli/basic.external-map.expect.css.map ./test/cli/basic.external-map.result.css.map | ||
fi | ||
|
||
# Zero out result file | ||
echo '' > ./test/cli/out/a.css | ||
|
@@ -67,9 +94,15 @@ postcss-base-plugin ./test/cli/src/a.css ./test/cli/src/b.css -m -d ./test/cli/o | |
|
||
# Check result | ||
git --no-pager diff --no-index --word-diff ./test/cli/out/a.css ./test/cli/out/a.expect.css | ||
git --no-pager diff --no-index --word-diff ./test/cli/out/a.css.map ./test/cli/out/a.expect.css.map | ||
git --no-pager diff --no-index --word-diff ./test/cli/out/b.css ./test/cli/out/b.expect.css | ||
git --no-pager diff --no-index --word-diff ./test/cli/out/b.css.map ./test/cli/out/b.expect.css.map | ||
|
||
if [[ "$OSTYPE" == "msys" ]]; then | ||
# CRLF on Windows makes it hard to test with base64 encoded sourcemaps | ||
echo 'did not compare actual output assuming exit 0 means everything is ok' | ||
else | ||
git --no-pager diff --no-index --word-diff ./test/cli/out/a.css.map ./test/cli/out/a.expect.css.map | ||
git --no-pager diff --no-index --word-diff ./test/cli/out/b.css.map ./test/cli/out/b.expect.css.map | ||
fi | ||
|
||
# Zero out result file | ||
echo '' > ./test/cli/out/concatenated.css | ||
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I often just do this
But feel free to leave it like this if you want to be specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly use the specific naming. This is more a reminder for myself that I imported the promises API further down in the code. :)