sourcecred/sharness
William Chargin eb8f2b975b
Make js_bundle_path test POSIX-compliant (#754)
Summary:
In #715, I used Bash arrays for convenience. Our tests should run under
POSIX `sh` (as on Travis and standard GNU/Linux). This patch
reimplements the check using only POSIX features.

Fixes #752.

Test Plan:
As is, `yarn test --full` passes on GNU/Linux and macOS(+GNU coreutils).

Change the glob from `main.*.js` to `*.js` and note that running the
test emits an error:

```
fatal: multiple main bundles found:
    build_output/output_NO_REPOS/static/js/main.6307f660.js
    build_output/output_NO_REPOS/static/js/ssr.e92af807.js
```

Change the glob from `main.*.js` to `nope.*.js` and note that running
the test emits an error:

```
fatal: no main bundle found
```

Revert the glob to normal and note that all tests run and pass.

(To run tests, `./test_build_static_site.t --chain-lint --long -v` from
the `sharness/` directory.)

wchargin-branch: posix-bundle-check
2018-09-03 10:51:16 -07:00
..
.gitignore Add a `.gitignore` for Sharness (#673) 2018-08-15 16:31:00 -07:00
Makefile Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
SHARNESS_LICENSE Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
aggregate-results.sh Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
dummy.t Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
sharness.sh Add `sharness` for shell-based testing (#597) 2018-08-06 12:56:25 -07:00
test_build_static_site.t Make js_bundle_path test POSIX-compliant (#754) 2018-09-03 10:51:16 -07:00