Skip to content

Commit

Permalink
Get back e2e binary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed Aug 25, 2024
1 parent ce1df85 commit c090038
Show file tree
Hide file tree
Showing 6 changed files with 5,134 additions and 72 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ jobs:
- run: opam exec -- dune build --verbose
- run: opam exec -- dune exec ODiffBin -- --version

- uses: pnpm/action-setup@v4
with:
version: 9

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install node deps
run: npm ci

- name: e2e test
run: pnpm test

4 changes: 3 additions & 1 deletion bin/node-bindings/odiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ function parsePixelDiffStdout(stdout) {
const CMD_BIN_HELPER_MSG =
"Usage: odiff [OPTION]... [BASE] [COMPARING] [DIFF]\nTry `odiff --help' for more information.\n";

const NO_FILE_ODIFF_ERROR_REGEX = /no\s+'([^']+)'\s+file\s+or\s+directory/;

async function compare(basePath, comparePath, diffOutput, options = {}) {
return new Promise((resolve, reject) => {
let producedStdout, producedStdError;
Expand Down Expand Up @@ -148,7 +150,7 @@ async function compare(basePath, comparePath, diffOutput, options = {}) {
).replace(CMD_BIN_HELPER_MSG, "");

const noFileOrDirectoryMatches = originalErrorMessage.match(
/no\n\s*`(.*)'\sfile or\n\s*directory/
NO_FILE_ODIFF_ERROR_REGEX
);

if (options.noFailOnFsErrors && noFileOrDirectoryMatches?.[1]) {
Expand Down
Loading

0 comments on commit c090038

Please sign in to comment.