Skip to content

Commit

Permalink
fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
vlio20 committed Dec 6, 2024
1 parent bb36ceb commit d0136ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/memoize/memoize.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { sleep } from '../common/test-utils';
import { describe, it, mock } from 'node:test';
import assert from 'node:assert';

declare const window: any;

describe('memozie', () => {
it('should verify memoize caching original method', (ctx, done) => {
describe('memoize', () => {
it('should verify memoize caching original method', (_, done) => {
const spy = mock.fn((x: number, y: number) => x + y);

class T {
Expand Down Expand Up @@ -53,7 +51,7 @@ describe('memozie', () => {
}, Error('@memoize is applicable only on a methods.'));
});

it('should use provided cache', (ctx, done) => {
it('should use provided cache', (_2, done) => {
const cache = new Map<string, number>();
const spy = mock.fn(() => 1);

Expand Down Expand Up @@ -85,6 +83,7 @@ describe('memozie', () => {

class T {

// eslint-disable-next-line class-methods-use-this
@memoize<T, string>({ expirationTimeMs: 10, keyResolver: mapper })
fooWithMapper(x: string, y: string): string {
return spyFooWithMapper(x, y);
Expand All @@ -109,6 +108,7 @@ describe('memozie', () => {
class T {
foo = spyMapper;

// eslint-disable-next-line class-methods-use-this
@memoize<T, string>({ expirationTimeMs: 10, keyResolver: 'foo' })
fooWithInnerMapper(x: string, y: string): string {
return spyFooWithMapper(x, y);
Expand Down

0 comments on commit d0136ef

Please sign in to comment.