diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-12-22 11:10:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-22 11:10:36 +0900 |
commit | b1a6f374dca078dee2406ebe049715b826e37ca2 (patch) | |
tree | 5367c48648e2018f55f12d847baba94559e10040 /test/background/usecases/filters.test.ts | |
parent | b2dcdedad729ff7087867da50e20578f9fc8fb29 (diff) | |
parent | da72c2ddd916d79d134662e3985b53a4ac78af7a (diff) |
Merge pull request #690 from ueokande/eslint-and-prettier
Eslint and prettier
Diffstat (limited to 'test/background/usecases/filters.test.ts')
-rw-r--r-- | test/background/usecases/filters.test.ts | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/test/background/usecases/filters.test.ts b/test/background/usecases/filters.test.ts index bdfb0be..90541ff 100644 --- a/test/background/usecases/filters.test.ts +++ b/test/background/usecases/filters.test.ts @@ -3,15 +3,15 @@ import * as filters from 'background/usecases/filters'; describe("background/usecases/filters", () => { describe('filterHttp', () => { it('filters http URLs duplicates to https hosts', () => { - let pages = [ + const pages = [ { url: 'http://i-beam.org/foo' }, { url: 'https://i-beam.org/bar' }, { url: 'http://i-beam.net/hoge' }, { url: 'http://i-beam.net/fuga' }, ]; - let filtered = filters.filterHttp(pages); + const filtered = filters.filterHttp(pages); - let urls = filtered.map(x => x.url); + const urls = filtered.map(x => x.url); expect(urls).to.deep.equal([ 'https://i-beam.org/bar', 'http://i-beam.net/hoge', 'http://i-beam.net/fuga' ]); @@ -20,12 +20,12 @@ describe("background/usecases/filters", () => { describe('filterBlankTitle', () => { it('filters blank titles', () => { - let pages = [ + const pages = [ { title: 'hello' }, { title: '' }, {}, ]; - let filtered = filters.filterBlankTitle(pages); + const filtered = filters.filterBlankTitle(pages); expect(filtered).to.deep.equal([{ title: 'hello' }]); }); @@ -33,15 +33,15 @@ describe("background/usecases/filters", () => { describe('filterByTailingSlash', () => { it('filters duplicated pathname on tailing slash', () => { - let pages = [ + const pages = [ { url: 'http://i-beam.org/content' }, { url: 'http://i-beam.org/content/' }, { url: 'http://i-beam.org/search' }, { url: 'http://i-beam.org/search?q=apple_banana_cherry' }, ]; - let filtered = filters.filterByTailingSlash(pages); + const filtered = filters.filterByTailingSlash(pages); - let urls = filtered.map(x => x.url); + const urls = filtered.map(x => x.url); expect(urls).to.deep.equal([ 'http://i-beam.org/content', 'http://i-beam.org/search', @@ -52,7 +52,7 @@ describe("background/usecases/filters", () => { describe('filterByPathname', () => { it('remains items less than minimam length', () => { - let pages = [ + const pages = [ { url: 'http://i-beam.org/search?q=apple' }, { url: 'http://i-beam.org/search?q=apple_banana' }, { url: 'http://i-beam.org/search?q=apple_banana_cherry' }, @@ -60,12 +60,12 @@ describe("background/usecases/filters", () => { { url: 'http://i-beam.org/request?q=apple_banana' }, { url: 'http://i-beam.org/request?q=apple_banana_cherry' }, ]; - let filtered = filters.filterByPathname(pages, 10); + const filtered = filters.filterByPathname(pages, 10); expect(filtered).to.have.lengthOf(6); }); it('filters by length of pathname', () => { - let pages = [ + const pages = [ { url: 'http://i-beam.org/search?q=apple' }, { url: 'http://i-beam.org/search?q=apple_banana' }, { url: 'http://i-beam.org/search?q=apple_banana_cherry' }, @@ -73,7 +73,7 @@ describe("background/usecases/filters", () => { { url: 'http://i-beam.net/search?q=apple_banana' }, { url: 'http://i-beam.net/search?q=apple_banana_cherry' }, ]; - let filtered = filters.filterByPathname(pages, 0); + const filtered = filters.filterByPathname(pages, 0); expect(filtered).to.deep.equal([ { url: 'http://i-beam.org/search?q=apple' }, { url: 'http://i-beam.net/search?q=apple' }, @@ -83,7 +83,7 @@ describe("background/usecases/filters", () => { describe('filterByOrigin', () => { it('remains items less than minimam length', () => { - let pages = [ + const pages = [ { url: 'http://i-beam.org/search?q=apple' }, { url: 'http://i-beam.org/search?q=apple_banana' }, { url: 'http://i-beam.org/search?q=apple_banana_cherry' }, @@ -91,12 +91,12 @@ describe("background/usecases/filters", () => { { url: 'http://i-beam.org/request?q=apple_banana' }, { url: 'http://i-beam.org/request?q=apple_banana_cherry' }, ]; - let filtered = filters.filterByOrigin(pages, 10); + const filtered = filters.filterByOrigin(pages, 10); expect(filtered).to.have.lengthOf(6); }); it('filters by length of pathname', () => { - let pages = [ + const pages = [ { url: 'http://i-beam.org/search?q=apple' }, { url: 'http://i-beam.org/search?q=apple_banana' }, { url: 'http://i-beam.org/search?q=apple_banana_cherry' }, @@ -104,7 +104,7 @@ describe("background/usecases/filters", () => { { url: 'http://i-beam.org/request?q=apple_banana' }, { url: 'http://i-beam.org/request?q=apple_banana_cherry' }, ]; - let filtered = filters.filterByOrigin(pages, 0); + const filtered = filters.filterByOrigin(pages, 0); expect(filtered).to.deep.equal([ { url: 'http://i-beam.org/search?q=apple' }, ]); |