Skip to content

Commit e970500

Browse files
test: fix them so they run
1 parent 26d962b commit e970500

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

lib/core/notification_center/notification_registry.tests.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2023, Optimizely
2+
* Copyright 2023-2024, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,9 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { describe, it } from 'mocha';
1817
import { expect } from 'chai';
19-
2018
import { NotificationRegistry } from './notification_registry';
2119

2220
describe('Notification Registry', () => {

lib/utils/lru_cache/lru_cache.tests.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2022, Optimizely
2+
* Copyright 2022, 2024 Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -242,28 +242,28 @@ describe('/lib/core/odp/lru_cache (Default)', () => {
242242
await sleep(150);
243243

244244
assert.equal(cache.map.size, 0);
245+
});
245246

246-
it('should be fully functional after resetting the cache', () => {
247-
cache.save({ key: 'c', value: 300 }); // { c: 300 }
248-
cache.save({ key: 'd', value: 400 }); // { c: 300, d: 400 }
249-
assert.isNull(cache.peek('b'));
250-
assert.equal(cache.peek('c'), 300);
251-
assert.equal(cache.peek('d'), 400);
252-
253-
cache.save({ key: 'a', value: 500 }); // { d: 400, a: 500 }
254-
cache.save({ key: 'b', value: 600 }); // { a: 500, b: 600 }
255-
assert.isNull(cache.peek('c'));
256-
assert.equal(cache.peek('a'), 500);
257-
assert.equal(cache.peek('b'), 600);
258-
259-
const _ = cache.lookup('a'); // { b: 600, a: 500 }
260-
assert.equal(500, _);
261-
262-
cache.save({ key: 'c', value: 700 }); // { a: 500, c: 700 }
263-
assert.isNull(cache.peek('b'));
264-
assert.equal(cache.peek('a'), 500);
265-
assert.equal(cache.peek('c'), 700);
266-
});
247+
it('should be fully functional after resetting the cache', () => {
248+
cache.save({ key: 'c', value: 300 }); // { c: 300 }
249+
cache.save({ key: 'd', value: 400 }); // { c: 300, d: 400 }
250+
assert.isNull(cache.peek('b'));
251+
assert.equal(cache.peek('c'), 300);
252+
assert.equal(cache.peek('d'), 400);
253+
254+
cache.save({ key: 'a', value: 500 }); // { d: 400, a: 500 }
255+
cache.save({ key: 'b', value: 600 }); // { a: 500, b: 600 }
256+
assert.isNull(cache.peek('c'));
257+
assert.equal(cache.peek('a'), 500);
258+
assert.equal(cache.peek('b'), 600);
259+
260+
const _ = cache.lookup('a'); // { b: 600, a: 500 }
261+
assert.equal(500, _);
262+
263+
cache.save({ key: 'c', value: 700 }); // { a: 500, c: 700 }
264+
assert.isNull(cache.peek('b'));
265+
assert.equal(cache.peek('a'), 500);
266+
assert.equal(cache.peek('c'), 700);
267267
});
268268
});
269269
});

0 commit comments

Comments
 (0)