Skip to content

Commit e9475e7

Browse files
authored
fix: don't fallback to default value in test harness (#165)
* chore: use non deprecated getBoolean instead of getBool * fix: don't fallback to testcase default value; getAssignment can not return null.
1 parent 2c696ac commit e9475e7

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ describe('EppoJSClient E2E test', () => {
358358
const client = getInstance();
359359

360360
const typeAssignmentFunctions = {
361-
[VariationType.BOOLEAN]: client.getBoolAssignment.bind(client),
361+
[VariationType.BOOLEAN]: client.getBooleanAssignment.bind(client),
362362
[VariationType.NUMERIC]: client.getNumericAssignment.bind(client),
363363
[VariationType.INTEGER]: client.getIntegerAssignment.bind(client),
364364
[VariationType.STRING]: client.getStringAssignment.bind(client),

test/testHelpers.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,13 @@ export function getTestAssignments(
9090
assignment: string | boolean | number | object;
9191
}[] = [];
9292
for (const subject of testCase.subjects) {
93-
const assignment =
94-
assignmentFn(
95-
testCase.flag,
96-
subject.subjectKey,
97-
subject.subjectAttributes,
98-
testCase.defaultValue,
99-
obfuscated,
100-
) || testCase.defaultValue; // Fallback to defaultValue if null
93+
const assignment = assignmentFn(
94+
testCase.flag,
95+
subject.subjectKey,
96+
subject.subjectAttributes,
97+
testCase.defaultValue,
98+
obfuscated,
99+
);
101100
assignments.push({ subject: subject, assignment: assignment });
102101
}
103102
return assignments;

0 commit comments

Comments
 (0)