-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves fixtures directory to the root, uses file snapshot in unit test, and creates test helper script for pipeline tests. Updates CONTRIBUTING. Tests will now all run instead of failing fast.
- Loading branch information
Showing
18 changed files
with
68 additions
and
66 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
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
2 changes: 1 addition & 1 deletion
2
src/fixtures/casing/camelCase.d.css.ts → fixtures/casing/camelCase.d.css.ts
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
2 changes: 1 addition & 1 deletion
2
src/fixtures/casing/camelCaseOnly.d.css.ts → fixtures/casing/camelCaseOnly.d.css.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/fixtures/casing/dashes.d.css.ts → fixtures/casing/dashes.d.css.ts
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
2 changes: 1 addition & 1 deletion
2
src/fixtures/casing/dashesOnly.d.css.ts → fixtures/casing/dashesOnly.d.css.ts
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
2 changes: 1 addition & 1 deletion
2
src/fixtures/casing/none.d.css.ts → fixtures/casing/none.d.css.ts
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
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/fixtures/foo.module.d.css.ts → fixtures/foo.module.d.css.ts
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
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# $1 is the input name, relative to `fixtures`. Required. | ||
input=$1 | ||
|
||
# $2 is the standard (before) options. Defaults to "". | ||
IFS=" " read -r -a beforeOpts <<< "${2:-}" | ||
|
||
# $3 is the output name, relative to `fixtures`. Defaults to $1. | ||
output=${3:-$1} | ||
|
||
# $4 is the after options. Use an array. Defaults to "". | ||
IFS=" " read -r -a afterOpts <<< "${4:-}" | ||
|
||
# $5 is the path prefix for output. Defaults to "". | ||
prefix=${5:-} | ||
|
||
# Run from $RUNNER_TEMP for auto-cleanup. | ||
cp fixtures/${input}.css $RUNNER_TEMP/test.css | ||
cp fixtures/${output}.d.css.ts $RUNNER_TEMP/expected.d.css.ts | ||
pushd $RUNNER_TEMP > /dev/null || exit | ||
|
||
# `./dist/main.js` is executing local `css-typed` as if installed (same as `bin`). | ||
# But it is `$GITHUB_WORKSPACE/dist/main.js` b/c we `cd $RUNNER_TEMP`. | ||
echo "css-typed ${beforeOpts[*]} \"*.css\" ${afterOpts[*]}" | ||
# shellcheck disable=SC2068 | ||
$GITHUB_WORKSPACE/dist/main.js ${beforeOpts[@]} "*.css" ${afterOpts[@]} | ||
|
||
# Use `diff` to compare the files. | ||
# Use `-I '//.*'` to ignore the first line (comment) which has generated path and timestamp. | ||
diff --color=auto --strip-trailing-cr -uI "//.*" expected.d.css.ts ${prefix}test.d.css.ts |
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