mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
Move CLI to apps/cli
This commit is contained in:
3
apps/cli/spec/bw.spec.ts
Normal file
3
apps/cli/spec/bw.spec.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
describe("bw", () => {
|
||||
it("is a placeholder test");
|
||||
});
|
||||
4
apps/cli/spec/helpers.ts
Normal file
4
apps/cli/spec/helpers.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// eslint-disable-next-line
|
||||
const TSConsoleReporter = require("jasmine-ts-console-reporter");
|
||||
jasmine.getEnv().clearReporters(); // Clear default console reporter
|
||||
jasmine.getEnv().addReporter(new TSConsoleReporter());
|
||||
7
apps/cli/spec/support/jasmine.json
Normal file
7
apps/cli/spec/support/jasmine.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"spec_dir": "spec",
|
||||
"spec_files": ["**/*[sS]pec.ts"],
|
||||
"helpers": ["helpers.ts"],
|
||||
"stopSpecOnExpectationFailure": false,
|
||||
"random": true
|
||||
}
|
||||
7
apps/cli/spec/tsconfig.json
Normal file
7
apps/cli/spec/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../tsconfig",
|
||||
"include": ["src", "spec"],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs"
|
||||
}
|
||||
}
|
||||
27
apps/cli/spec/utils.spec.ts
Normal file
27
apps/cli/spec/utils.spec.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { FlagName } from "../src/flags";
|
||||
import { CliUtils } from "../src/utils";
|
||||
describe("flagEnabled", () => {
|
||||
it("is true if flag is null", () => {
|
||||
process.env.FLAGS = JSON.stringify({ test: null });
|
||||
|
||||
expect(CliUtils.flagEnabled("test" as FlagName)).toBe(true);
|
||||
});
|
||||
|
||||
it("is true if flag is undefined", () => {
|
||||
process.env.FLAGS = JSON.stringify({});
|
||||
|
||||
expect(CliUtils.flagEnabled("test" as FlagName)).toBe(true);
|
||||
});
|
||||
|
||||
it("is true if flag is true", () => {
|
||||
process.env.FLAGS = JSON.stringify({ test: true });
|
||||
|
||||
expect(CliUtils.flagEnabled("test" as FlagName)).toBe(true);
|
||||
});
|
||||
|
||||
it("is false if flag is false", () => {
|
||||
process.env.FLAGS = JSON.stringify({ test: false });
|
||||
|
||||
expect(CliUtils.flagEnabled("test" as FlagName)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user