Skip to content

Commit

Permalink
Bump Deno runtime to 2.1.3 and dev deps deps (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
petruki authored Dec 7, 2024
1 parent 4d1dfc3 commit 06ebe33
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]')"
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down
10 changes: 9 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/deps.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { existsSync } from 'jsr:@std/fs@1.0.5';
export { existsSync } from 'jsr:@std/fs@1.0.6';
10 changes: 5 additions & 5 deletions test/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ 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,
afterAll,
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';
22 changes: 4 additions & 18 deletions test/switcher-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ describe('E2E test - Client testing (assume) feature:', function () {

beforeEach(function() {
Client.clearLogger();
Client.forget('FF2FOR2020');
switcher = Client.getSwitcher();
});

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 06ebe33

Please sign in to comment.