Skip to content

Commit d2160b2

Browse files
committed
test: update test implementation to work well with typescript 6
1 parent b23b54b commit d2160b2

31 files changed

Lines changed: 55 additions & 27 deletions

packages/sdk/akamai-base/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EdgeProvider, init } from '../src/index';
2-
import * as testData from './testData.json';
2+
import testData from './testData.json';
33

44
const sdkKey = 'test-sdk-key';
55
const flagKey1 = 'testFlag1';

packages/sdk/akamai-base/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"strict": true,
1010
"noImplicitOverride": true,
1111
"allowSyntheticDefaultImports": true,
12+
"esModuleInterop": true,
1213
"sourceMap": true,
1314
"allowJs": true,
1415
"declaration": true,

packages/sdk/akamai-edgekv/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import EdgeKVProvider from '../src/edgekv/edgeKVProvider';
22
import { init as initWithEdgeKV, LDClient, LDContext, LDLogger } from '../src/index';
3-
import * as testData from './testData.json';
3+
import testData from './testData.json';
44

55
jest.mock('../src/edgekv/edgekv', () => ({
66
EdgeKV: jest.fn(),

packages/sdk/akamai-edgekv/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"strict": true,
1010
"noImplicitOverride": true,
1111
"allowSyntheticDefaultImports": true,
12+
"esModuleInterop": true,
1213
"sourceMap": true,
1314
"allowJs": true,
1415
"declaration": true,

packages/sdk/cloudflare/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Miniflare } from 'miniflare';
44
import { LDClient, LDContext } from '@launchdarkly/js-server-sdk-common-edge';
55

66
import { init } from '../src/index';
7-
import * as allFlagsSegments from './testData.json';
7+
import allFlagsSegments from './testData.json';
88

99
const mf = new Miniflare({
1010
modules: true,

packages/sdk/cloudflare/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
4+
"esModuleInterop": true,
45
"declaration": true,
56
"declarationMap": true,
67
"lib": ["es6"],

packages/sdk/fastly/__tests__/api/EdgeFeatureStore.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AsyncStoreFacade, LDFeatureStore } from '@launchdarkly/js-server-sdk-co
22

33
import { EdgeFeatureStore } from '../../src/api/EdgeFeatureStore';
44
import mockEdgeProvider from '../utils/mockEdgeProvider';
5-
import * as testData from './testData.json';
5+
import testData from './testData.json';
66

77
describe('EdgeFeatureStore', () => {
88
const clientSideId = 'client-side-id';

packages/sdk/fastly/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { KVStore } from 'fastly:kv-store';
33

44
import { LDClient } from '../src/api';
55
import { init } from '../src/index';
6-
import * as testData from './utils/testData.json';
6+
import testData from './utils/testData.json';
77

88
// Tell Jest to use the manual mock
99
jest.mock('fastly:kv-store');
Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
{
2-
"transform": { "^.+\\.ts?$": "ts-jest" },
3-
"testMatch": ["**/*.test.ts?(x)"],
4-
"testPathIgnorePatterns": ["node_modules", "example", "dist"],
5-
"modulePathIgnorePatterns": ["dist"],
2+
"transform": {
3+
"^.+\\.ts?$": "ts-jest"
4+
},
5+
"testMatch": [
6+
"**/*.test.ts?(x)"
7+
],
8+
"testPathIgnorePatterns": [
9+
"node_modules",
10+
"example",
11+
"dist"
12+
],
13+
"modulePathIgnorePatterns": [
14+
"dist"
15+
],
616
"testEnvironment": "node",
7-
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
8-
"collectCoverageFrom": ["src/**/*.ts"]
17+
"moduleFileExtensions": [
18+
"ts",
19+
"tsx",
20+
"js",
21+
"jsx",
22+
"json",
23+
"node"
24+
],
25+
"collectCoverageFrom": [
26+
"src/**/*.ts"
27+
]
928
}

packages/sdk/fastly/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"strict": true,
1010
"noImplicitOverride": true,
1111
"allowSyntheticDefaultImports": true,
12+
"esModuleInterop": true,
1213
"sourceMap": true,
1314
"declaration": true,
1415
"declarationMap": true, // enables importers to jump to source

0 commit comments

Comments
 (0)