Skip to content

Commit

Permalink
test(locals): use cache syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Dec 20, 2019
1 parent c6e6e6b commit aed8240
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/scripts/hexo/locals.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ describe('Locals', () => {
locals.set('foo', () => 'foo');

// cache should be clear after new data is set
should.not.exist(locals.cache.cache.foo);
locals.cache.has('foo').should.eql(false);
locals.get('foo').should.eql('foo');
// cache should be saved once it's get
locals.cache.cache.foo.should.eql('foo');
locals.cache.get('foo').should.eql('foo');
});

it('set() - not function', () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('Locals', () => {
locals.remove('foo');

should.not.exist(locals.getters.foo);
should.not.exist(locals.cache.cache.foo);
locals.cache.has('foo').should.eql(false);
});

it('remove() - name must be a string', () => {
Expand Down Expand Up @@ -100,6 +100,6 @@ describe('Locals', () => {
locals.get('foo');
locals.invalidate();

should.not.exist(locals.cache.cache.foo);
locals.cache.has('foo').should.eql(false);
});
});

0 comments on commit aed8240

Please sign in to comment.