Skip to content

Commit

Permalink
chore: renamed test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
petruki committed Feb 26, 2025
1 parent 556b703 commit 82e32d7
Show file tree
Hide file tree
Showing 25 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
deno-version: [v1.46.3, v2.1.10]
deno-version: [v1.46.3, v2.x]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
Expand Down
2 changes: 1 addition & 1 deletion .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ ignore: {}
patch: {}
exclude:
global:
- test/**
- tests/**
6 changes: 3 additions & 3 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"lcov": "deno coverage coverage --lcov --output=coverage/report.lcov",
"clean": "rm -rf ./npm ./coverage ./generated-snapshots",
"cover": "deno task clean && deno task test && deno task lcov && genhtml -o coverage/html coverage/report.lcov",
"play": "deno run -A test/playground/index.ts"
"play": "deno run -A tests/playground/index.ts"
},
"exports": "./mod.ts",
"publish": {
"exclude": [
".github",
".vscode",
"test",
"tests",
"sonar-project.properties",
".snyk"
]
Expand All @@ -31,7 +31,7 @@
"lock": false,
"test": {
"include": [
"test/**/*.ts"
"tests/**/*.ts"
]
}
}
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sonar.projectVersion=2.1.0
sonar.javascript.lcov.reportPaths=coverage/report.lcov

sonar.sources=src
sonar.tests=test
sonar.tests=tests
sonar.language=typescript

sonar.dynamicAnalysis=reuseReports
Expand All @@ -15,7 +15,7 @@ sonar.exclusions=mod.ts,src/lib/utils/timed-match/worker.ts
# Ignore invalid rule for Deno tests
sonar.issue.ignore.multicriteria=e1
sonar.issue.ignore.multicriteria.e1.ruleKey=typescript:S2187
sonar.issue.ignore.multicriteria.e1.resourceKey=test/**/*.ts
sonar.issue.ignore.multicriteria.e1.resourceKey=tests/**/*.ts

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/playground/index.ts → tests/playground/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const domain = 'Playground';
const component = 'switcher-playground';
const environment = 'default';
const url = 'https://api.switcherapi.com';
const snapshotLocation = './test/playground/snapshot/';
const snapshotLocation = './tests/playground/snapshot/';

let switcher: Switcher;

Expand All @@ -25,14 +25,14 @@ async function setupSwitcher(local: boolean) {
* This code snippet is a minimal example of how to configure and use Switcher4Deno locally.
* No remote API account is required.
*
* Snapshot is loaded from file at test/playground/snapshot/local.json
* Snapshot is loaded from file at tests/playground/snapshot/local.json
*/
const _testLocal = async () => {
Client.buildContext({
domain: 'Local Playground',
environment: 'local'
}, {
snapshotLocation: './test/playground/snapshot',
snapshotLocation: './tests/playground/snapshot',
local: true
});

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const domain = 'Business';
const component = 'business-service';
const environment = 'default';
const url = 'http://localhost:3000';
const snapshotLocation = './test/snapshot/';
const snapshotLocation = './tests/snapshot/';

describe('E2E test - Client local:', function () {
beforeAll(async function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('Integrated test - Client:', function () {

const forceRemoteOptions = {
local: true,
snapshotLocation: './test/snapshot/',
snapshotLocation: './tests/snapshot/',
regexSafe: false
};

Expand Down Expand Up @@ -311,7 +311,7 @@ describe('Integrated test - Client:', function () {
});

it('should use silent mode when fail to check switchers', async function() {
Client.buildContext(contextSettings, { silentMode: '5m', regexSafe: false, snapshotLocation: './test/snapshot/' });
Client.buildContext(contextSettings, { silentMode: '5m', regexSafe: false, snapshotLocation: './tests/snapshot/' });
await assertRejects(async () =>
await Client.checkSwitchers(['FEATURE01', 'FEATURE02']),
Error, 'Something went wrong: [FEATURE01,FEATURE02] not found');
Expand All @@ -326,7 +326,7 @@ describe('Integrated test - Client:', function () {

// test
let asyncErrorMessage = null;
Client.buildContext(contextSettings, { silentMode: '5m', regexSafe: false, snapshotLocation: './test/snapshot/' });
Client.buildContext(contextSettings, { silentMode: '5m', regexSafe: false, snapshotLocation: './tests/snapshot/' });
Client.subscribeNotifyError((error) => asyncErrorMessage = error.message);

const switcher = Client.getSwitcher();
Expand Down Expand Up @@ -570,7 +570,7 @@ describe('Integrated test - Client:', function () {
it('should run in silent mode', async function () {
// setup context to read the snapshot in case the API does not respond
Client.buildContext(contextSettings, {
snapshotLocation: './test/snapshot/',
snapshotLocation: './tests/snapshot/',
regexSafe: false,
silentMode: '2s',
});
Expand Down Expand Up @@ -616,7 +616,7 @@ describe('Integrated test - Client:', function () {

it('should run in silent mode when API is unavailable', async function () {
Client.buildContext(contextSettings, {
snapshotLocation: './test/snapshot/',
snapshotLocation: './tests/snapshot/',
regexSafe: false,
silentMode: '5m'
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('E2E test - Client local - Snapshot:', function () {
const token = '[token]';
let contextSettings: SwitcherContext;

const dataBuffer = Deno.readTextFileSync('./test/snapshot/dev.json');
const dataBuffer = Deno.readTextFileSync('./tests/snapshot/dev.json');
const dataJSON = dataBuffer.toString();

const dataBufferV2 = Deno.readTextFileSync('./test/snapshot/dev_v2.json');
const dataBufferV2 = Deno.readTextFileSync('./tests/snapshot/dev_v2.json');
const dataJSONV2 = dataBufferV2.toString();

beforeEach(function() {
Expand All @@ -28,7 +28,7 @@ describe('E2E test - Client local - Snapshot:', function () {
};

Client.buildContext(contextSettings, {
snapshotLocation: './test/snapshot/',
snapshotLocation: './tests/snapshot/',
local: true,
regexSafe: false
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { assertTrue, WaitSafe } from './helper/utils.ts';
import { Client } from '../mod.ts';

const updateSwitcher = (status: boolean) => {
const dataBuffer = Deno.readTextFileSync('./test/snapshot/dev.json');
const dataBuffer = Deno.readTextFileSync('./tests/snapshot/dev.json');
const dataJSON = JSON.parse(dataBuffer.toString());

dataJSON.data.domain.group[0].config[0].activated = status;
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 82e32d7

Please sign in to comment.