@@ -29,11 +29,9 @@ import {
29
29
VARIABLE_KEY_NOT_IN_DATAFILE ,
30
30
FEATURE_NOT_IN_DATAFILE ,
31
31
UNABLE_TO_CAST_VALUE ,
32
- } from '../error_messages' ;
33
- import exp from 'constants' ;
32
+ } from 'error_message' ;
34
33
import { VariableType } from '../shared_types' ;
35
34
import { OptimizelyError } from '../error/optimizly_error' ;
36
- import { J } from 'vitest/dist/chunks/environment.0M5R1SX_.js' ;
37
35
38
36
const createLogger = ( ...args : any ) => ( {
39
37
debug : ( ) => { } ,
@@ -53,7 +51,7 @@ describe('createProjectConfig', () => {
53
51
const testData : Record < string , any > = testDatafile . getTestProjectConfig ( ) ;
54
52
configObj = projectConfig . createProjectConfig ( testData as JSON ) ;
55
53
56
- forEach ( testData . audiences , audience => {
54
+ forEach ( testData . audiences , ( audience : any ) => {
57
55
audience . conditions = JSON . parse ( audience . conditions ) ;
58
56
} ) ;
59
57
@@ -80,14 +78,14 @@ describe('createProjectConfig', () => {
80
78
expect ( configObj . groupIdMap ) . toEqual ( expectedGroupIdMap ) ;
81
79
82
80
const expectedExperiments = testData . experiments . slice ( ) ;
83
- forEach ( configObj . groupIdMap , ( group , groupId ) => {
84
- forEach ( group . experiments , experiment => {
81
+ forEach ( configObj . groupIdMap , ( group : any , groupId : any ) => {
82
+ forEach ( group . experiments , ( experiment : any ) => {
85
83
experiment . groupId = groupId ;
86
84
expectedExperiments . push ( experiment ) ;
87
85
} ) ;
88
86
} ) ;
89
87
90
- forEach ( expectedExperiments , experiment => {
88
+ forEach ( expectedExperiments , ( experiment : any ) => {
91
89
experiment . variationKeyMap = fns . keyBy ( experiment . variations , 'key' ) ;
92
90
} ) ;
93
91
@@ -1049,7 +1047,7 @@ describe('tryCreatingProjectConfig', () => {
1049
1047
vi . restoreAllMocks ( ) ;
1050
1048
} ) ;
1051
1049
1052
- it ( 'returns a project config object created by createProjectConfig when all validation is applied and there are no errors' , ( ) => {
1050
+ it ( 'should return a project config object created by createProjectConfig when all validation is applied and there are no errors' , ( ) => {
1053
1051
const configDatafile = {
1054
1052
foo : 'bar' ,
1055
1053
experiments : [ { key : 'a' } , { key : 'b' } ] ,
@@ -1077,7 +1075,7 @@ describe('tryCreatingProjectConfig', () => {
1077
1075
expect ( result ) . toMatchObject ( configObj ) ;
1078
1076
} ) ;
1079
1077
1080
- it ( 'throws an error when validateDatafile throws' , function ( ) {
1078
+ it ( 'should throw an error when validateDatafile throws' , function ( ) {
1081
1079
vi . spyOn ( configValidator , 'validateDatafile' ) . mockImplementationOnce ( ( ) => {
1082
1080
throw new Error ( ) ;
1083
1081
} ) ;
@@ -1092,11 +1090,11 @@ describe('tryCreatingProjectConfig', () => {
1092
1090
) . toThrowError ( ) ;
1093
1091
} ) ;
1094
1092
1095
- it ( 'throws an error when jsonSchemaValidator.validate throws' , function ( ) {
1093
+ it ( 'should throw an error when jsonSchemaValidator.validate throws' , function ( ) {
1096
1094
vi . spyOn ( configValidator , 'validateDatafile' ) . mockReturnValueOnce ( true ) ;
1097
1095
mockJsonSchemaValidator . mockImplementationOnce ( ( ) => {
1098
1096
throw new Error ( ) ;
1099
- } )
1097
+ } ) ;
1100
1098
1101
1099
expect ( ( ) =>
1102
1100
projectConfig . tryCreatingProjectConfig ( {
@@ -1107,7 +1105,7 @@ describe('tryCreatingProjectConfig', () => {
1107
1105
) . toThrowError ( ) ;
1108
1106
} ) ;
1109
1107
1110
- it ( 'skips json validation when jsonSchemaValidator is not provided' , function ( ) {
1108
+ it ( 'should skip json validation when jsonSchemaValidator is not provided' , function ( ) {
1111
1109
const configDatafile = {
1112
1110
foo : 'bar' ,
1113
1111
experiments : [ { key : 'a' } , { key : 'b' } ] ,
0 commit comments