diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 6482a41..92ead24 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - deno-version: [v1.46.3, v2.0.4] + deno-version: [v1.46.3, v2.1.3] os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" diff --git a/.vscode/settings.json b/.vscode/settings.json index c68e2d1..d9f3b4e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,11 @@ { "deno.enable": true, - "deno.unstable": true, + "deno.testing.args": [ + "--allow-read", + "--allow-net", + "--allow-write", + "--allow-import" + ], "[typescript]": { "editor.defaultFormatter": "vscode.typescript-language-features" }, diff --git a/deno.lock b/deno.lock index a3d6aaa..de720f9 100644 --- a/deno.lock +++ b/deno.lock @@ -4,9 +4,11 @@ "jsr:@std/fs@1.0.2": "1.0.2", "jsr:@std/fs@1.0.4": "1.0.4", "jsr:@std/fs@1.0.5": "1.0.5", + "jsr:@std/fs@1.0.6": "1.0.6", "jsr:@std/path@^1.0.3": "1.0.3", "jsr:@std/path@^1.0.6": "1.0.6", - "jsr:@std/path@^1.0.7": "1.0.8" + "jsr:@std/path@^1.0.7": "1.0.8", + "jsr:@std/path@^1.0.8": "1.0.8" }, "jsr": { "@std/fs@1.0.2": { @@ -27,6 +29,12 @@ "jsr:@std/path@^1.0.7" ] }, + "@std/fs@1.0.6": { + "integrity": "42b56e1e41b75583a21d5a37f6a6a27de9f510bcd36c0c85791d685ca0b85fa2", + "dependencies": [ + "jsr:@std/path@^1.0.8" + ] + }, "@std/path@1.0.3": { "integrity": "cd89d014ce7eb3742f2147b990f6753ee51d95276bfc211bc50c860c1bc7df6f" }, diff --git a/src/deps.ts b/src/deps.ts index 3ca1e90..18ca539 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1 +1 @@ -export { existsSync } from 'jsr:@std/fs@1.0.5'; +export { existsSync } from 'jsr:@std/fs@1.0.6'; diff --git a/test/deps.ts b/test/deps.ts index 09cf119..f502902 100644 --- a/test/deps.ts +++ b/test/deps.ts @@ -6,8 +6,8 @@ export { assertExists, assertNotEquals, assertArrayIncludes -} from 'jsr:@std/assert@1.0.7';; -export { assertSpyCalls, spy } from 'jsr:@std/testing@1.0.4/mock'; +} from 'jsr:@std/assert@1.0.9';; +export { assertSpyCalls, spy } from 'jsr:@std/testing@1.0.6/mock'; export { describe, it, @@ -15,7 +15,7 @@ export { beforeEach, beforeAll, afterEach -} from 'jsr:@std/testing@1.0.4/bdd'; -export { delay } from 'jsr:@std/async@1.0.8/delay'; -export { existsSync } from 'jsr:@std/fs@1.0.5'; +} from 'jsr:@std/testing@1.0.6/bdd'; +export { delay } from 'jsr:@std/async@1.0.9/delay'; +export { existsSync } from 'jsr:@std/fs@1.0.6'; export * as mf from 'https://deno.land/x/mock_fetch@0.3.0/mod.ts'; \ No newline at end of file diff --git a/test/switcher-client.test.ts b/test/switcher-client.test.ts index f198ff2..0c04afa 100644 --- a/test/switcher-client.test.ts +++ b/test/switcher-client.test.ts @@ -235,6 +235,7 @@ describe('E2E test - Client testing (assume) feature:', function () { beforeEach(function() { Client.clearLogger(); + Client.forget('FF2FOR2020'); switcher = Client.getSwitcher(); }); @@ -284,30 +285,15 @@ describe('E2E test - Client testing (assume) feature:', function () { Error, 'Something went wrong: {"error":"Unable to load a key UNKNOWN"}'); }); - it('should enable test mode which will prevent a snapshot to be watchable', testSettings, async function () { - //given - Client.buildContext({ url, apiKey, domain, component, environment }, { - local: true, logger: true, regexSafe: false - }); - - switcher = Client.getSwitcher(); - - //test - Client.assume('FF2FOR2020').false(); - assertFalse(await switcher.isItOn('FF2FOR2020')); - Client.assume('FF2FOR2020').true(); - assertTrue(await switcher.isItOn('FF2FOR2020')); - }); - it('should return true using Client.assume only when Strategy input values match', testSettings, async function () { await switcher - .checkValue('Japan') + .checkValue('Canada') // result to be false .checkNetwork('10.0.0.3') .prepare('FF2FOR2020'); - assertTrue(await switcher.isItOn()); + assertFalse(await switcher.isItOn()); Client.assume('FF2FOR2020').true() - .when(StrategiesType.VALUE, 'Japan') + .when(StrategiesType.VALUE, 'Canada') // manipulate the condition to result to true .and(StrategiesType.NETWORK, '10.0.0.3'); assertTrue(await switcher.isItOn());