1
0
mirror of https://github.com/bitwarden/cli synced 2025-12-06 04:23:19 +00:00

Create testing framework for CLI (#453)

* Create testing framework for CLI

- Need to add tsconfig for specs to convert module format and add spec
dir to output
- Use jasmine-ts to test

expected dev cycle would be to have two watchers, one for jslib
and one for CLI tests. We could add jslib tests to this jasmine config,
but it feels wrong to test a submodule

* Run prettier

* Add tests to build pipeline

* Include required package

* Add placeholder test

* Run prettier

* Add nodemon and fix watch
This commit is contained in:
Matt Gibson
2022-01-21 11:28:36 -05:00
committed by GitHub
parent 8b650666c5
commit 21e8db9636
8 changed files with 2173 additions and 77 deletions

3
spec/bw.spec.ts Normal file
View File

@@ -0,0 +1,3 @@
describe("bw", () => {
it("is a placeholder test");
});

4
spec/helpers.ts Normal file
View File

@@ -0,0 +1,4 @@
// tslint:disable-next-line
const TSConsoleReporter = require("jasmine-ts-console-reporter");
jasmine.getEnv().clearReporters(); // Clear default console reporter
jasmine.getEnv().addReporter(new TSConsoleReporter());

View File

@@ -0,0 +1,7 @@
{
"spec_dir": "spec",
"spec_files": ["**/*[sS]pec.ts"],
"helpers": ["helpers.ts"],
"stopSpecOnExpectationFailure": false,
"random": true
}

7
spec/tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
"extends": "../tsconfig",
"include": ["src", "spec"],
"compilerOptions": {
"module": "commonjs"
}
}