Skip to content

Commit

Permalink
add -ver integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Jul 30, 2024
1 parent 9606de6 commit 9f8cd1f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions test/integration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require("node:fs");
const cp = require("node:child_process");
const assert = require("node:assert");

describe("spawned exiftool", () => {
it("-ver", () => {
const path = require("..");
const child = cp.spawnSync(path, ["-ver"]);
const ver = child.stdout.toString().trim();
console.log({ version: ver });
assert(
/^\d\d\.\d\d$/.test(ver),
"version is expected to be MAJOR.MINOR but was " + JSON.stringify(ver),
);
const stderr = child.stderr.toString();
assert(
stderr === "",
"stderr is expected to be empty but was " + JSON.stringify(stderr),
);
});
});
4 changes: 2 additions & 2 deletions test/path-exists.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs");
var assert = require("assert");
const fs = require("node:fs");
const assert = require("node:assert");

describe("exported path", () => {
it("is a valid path to a file", () => {
Expand Down

0 comments on commit 9f8cd1f

Please sign in to comment.