Skip to content

Commit

Permalink
chore: fixed redis test
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Jun 13, 2022
1 parent 1f8597f commit b662cdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"del": "^6.1.1",
"delay": "^5.0.0",
"eslint": "^8.17.0",
"ioredis": "^5.0.6",
"ioredis-mock": "^8.2.2",
"xo": "^0.50.0"
},
"engines": {
Expand Down
5 changes: 3 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const path = require('path');

const I18N = require('@ladjs/i18n');
const Redis = require('ioredis-mock');
const del = require('del');
const test = require('ava');
const delay = require('delay');
const test = require('ava');

const Mandarin = require('..');

Expand All @@ -12,7 +13,7 @@ test('translates a basic phrase to multiple languages', async (t) => {
const i18n = new I18N({ autoReload: true });
const hello = i18n.api.t({ phrase: 'Hello', locale: 'en' });
t.is(hello, 'Hello');
const mandarin = new Mandarin({ i18n });
const mandarin = new Mandarin({ i18n, redis: new Redis() });
await mandarin.translate();
// allow auto-reload to occur
await delay(1000);
Expand Down

0 comments on commit b662cdb

Please sign in to comment.