Skip to content

Commit

Permalink
fix: make unit tests and eslint pass
Browse files Browse the repository at this point in the history
  • Loading branch information
oJshua committed Mar 9, 2021
1 parent 1a427c4 commit 379e703
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 110 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
"parserOptions": { "project": "./tsconfig.json" },
"env": { "es6": true },
"ignorePatterns": ["node_modules", "build", "coverage"],
"plugins": ["import", "eslint-comments", "functional"],
"plugins": ["import", "eslint-comments"],
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:functional/lite",
"prettier",
"prettier/@typescript-eslint"
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@
"timeout": "60s",
"typescript": {
"rewritePaths": {
"src/": "build/main/"
"src/": "dist/main/"
}
},
"files": [
"!build/module/**"
"!dist/module/**"
]
},
"config": {
Expand Down
8 changes: 8 additions & 0 deletions src/lib/tokenlist.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import test from 'ava';

import { ENV, Strategy, TokenListProvider } from './tokenlist';

test('Token list is filterable by a tag', async (t) => {
Expand Down Expand Up @@ -26,3 +27,10 @@ test('Token list can exclude by a chain', async (t) => {

t.false(list.some((item) => item.chainId === ENV.MainnetBeta));
});

test('Token list returns new object upon filter', async (t) => {
const list = await new TokenListProvider().resolve(Strategy.Static);
const filtered = list.filterByChainId(ENV.MainnetBeta);
t.true(list !== filtered);
t.true(list.getList().length !== filtered.getList().length);
});
2 changes: 1 addition & 1 deletion src/lib/tokenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ export class TokenListContainer {

getList = () => {
return this.tokenList;
}
};
}
8 changes: 0 additions & 8 deletions src/lib/tokens.spec.ts

This file was deleted.

97 changes: 0 additions & 97 deletions src/lib/tokens.ts

This file was deleted.

0 comments on commit 379e703

Please sign in to comment.