Skip to content

Commit

Permalink
Fixed test, broke build
Browse files Browse the repository at this point in the history
  • Loading branch information
notjosh committed Apr 12, 2021
1 parent a42d720 commit 65bfb84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,20 +239,20 @@ test('prototype support', t => {

test('.decorator()', t => {
class TestClass {
index = 0;
constructor(public index: number) {}

@mem.decorator()
counter() {
return ++this.index;
}
}

const alpha = new TestClass();
const alpha = new TestClass(0);
t.is(alpha.counter(), 1);
t.is(alpha.counter(), 1, 'The method should be memoized');

const beta = new TestClass();
t.is(beta.counter(), 1, 'The method should not be memoized across instances');
const beta = new TestClass(100);
t.is(beta.counter(), 101, 'The method should not be memoized across instances');
});

test('mem.clear() throws when called with a plain function', t => {
Expand Down

0 comments on commit 65bfb84

Please sign in to comment.