diff --git a/tests/cli.test.js b/tests/cli.test.js index 9a99f26..5070c48 100644 --- a/tests/cli.test.js +++ b/tests/cli.test.js @@ -1,6 +1,7 @@ const app = require('../index'); const { version } = require('../package.json'); const fs = require('fs/promises'); +const { exec } = require("child_process"); let consoleErrSpy, consoleWarnSpy, consoleInfSpy, consoleLogSpy, mockExit; const initString = `STAC Node Validator v${version}`; @@ -20,6 +21,15 @@ beforeEach(() => { consoleErrSpy = jest.spyOn(console, 'error').mockImplementation(); }); +it('Should be executable via shell', done => { + exec("stac-node-validator --version", (error, stdout, stderr) => { + expect(error).toBe(null); + expect(stderr).toBe(""); + expect(stdout).toContain(version); + done(); + }); +}); + it('Should print init string', async () => { await app();