aboutsummaryrefslogtreecommitdiff
path: root/test/content/usecases
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 10:28:14 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 10:48:39 +0900
commit029d5365e7d74e87375fccb8db097b7c2df3f7f4 (patch)
tree6a24c719da9c60461c7e2fe120b0d42af9e580f2 /test/content/usecases
parentd72012529bcd820598fa64e1aa20dab1c16acaa5 (diff)
npm run lint:fix
Diffstat (limited to 'test/content/usecases')
-rw-r--r--test/content/usecases/ClipboardUseCase.test.ts18
-rw-r--r--test/content/usecases/FindUseCase.test.ts2
-rw-r--r--test/content/usecases/HintKeyProducer.test.ts6
-rw-r--r--test/content/usecases/KeymapUseCase.test.ts10
-rw-r--r--test/content/usecases/SettingUseCaase.test.ts6
5 files changed, 21 insertions, 21 deletions
diff --git a/test/content/usecases/ClipboardUseCase.test.ts b/test/content/usecases/ClipboardUseCase.test.ts
index a863651..2e711c6 100644
--- a/test/content/usecases/ClipboardUseCase.test.ts
+++ b/test/content/usecases/ClipboardUseCase.test.ts
@@ -14,7 +14,7 @@ describe('ClipboardUseCase', () => {
let sut: ClipboardUseCase;
beforeEach(() => {
- var modal = <ConsoleClient>{};
+ const modal = <ConsoleClient>{};
clipboardRepository = <ClipboardRepository>{ read() {}, write(_) {} };
operationClient = <OperationClient>{ internalOpenUrl(_) {} };
@@ -29,13 +29,13 @@ describe('ClipboardUseCase', () => {
describe('#yankCurrentURL', () => {
it('yanks current url', async () => {
- let href = window.location.href;
- var mockRepository = sinon.mock(clipboardRepository);
+ const href = window.location.href;
+ const mockRepository = sinon.mock(clipboardRepository);
mockRepository.expects('write').withArgs(href);
- var mockConsoleClient = sinon.mock(consoleClient);
+ const mockConsoleClient = sinon.mock(consoleClient);
mockConsoleClient.expects('info').withArgs('Yanked ' + href);
- let yanked = await sut.yankCurrentURL();
+ const yanked = await sut.yankCurrentURL();
expect(yanked).to.equal(href);
mockRepository.verify();
@@ -45,9 +45,9 @@ describe('ClipboardUseCase', () => {
describe('#openOrSearch', () => {
it('opens url from the clipboard', async () => {
- let url = 'https://github.com/ueokande/vim-vixen'
+ const url = 'https://github.com/ueokande/vim-vixen'
sinon.stub(clipboardRepository, 'read').returns(url);
- let mockOperationClient = sinon.mock(operationClient);
+ const mockOperationClient = sinon.mock(operationClient);
mockOperationClient.expects('internalOpenUrl').withArgs(url, true);
await sut.openOrSearch(true);
@@ -56,9 +56,9 @@ describe('ClipboardUseCase', () => {
});
it('opens search results from the clipboard', async () => {
- let url = 'https://google.com/search?q=banana';
+ const url = 'https://google.com/search?q=banana';
sinon.stub(clipboardRepository, 'read').returns('banana');
- let mockOperationClient = sinon.mock(operationClient);
+ const mockOperationClient = sinon.mock(operationClient);
mockOperationClient.expects('internalOpenUrl').withArgs(url, true);
await sut.openOrSearch(true);
diff --git a/test/content/usecases/FindUseCase.test.ts b/test/content/usecases/FindUseCase.test.ts
index ddd4cd4..3978dbc 100644
--- a/test/content/usecases/FindUseCase.test.ts
+++ b/test/content/usecases/FindUseCase.test.ts
@@ -32,7 +32,7 @@ class MockFindPresenter implements FindPresenter {
}
find(keyword: string, _backward: boolean): boolean {
- let found = this.document.includes(keyword);
+ const found = this.document.includes(keyword);
this.highlighted = found;
return found;
}
diff --git a/test/content/usecases/HintKeyProducer.test.ts b/test/content/usecases/HintKeyProducer.test.ts
index feafffb..5841ae9 100644
--- a/test/content/usecases/HintKeyProducer.test.ts
+++ b/test/content/usecases/HintKeyProducer.test.ts
@@ -10,13 +10,13 @@ describe('HintKeyProducer class', () => {
describe('#produce', () => {
it('produce incremented keys', () => {
- let charset = 'abc';
- let sequences = [
+ const charset = 'abc';
+ const sequences = [
'a', 'b', 'c',
'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca', 'cb', 'cc',
'aaa', 'aab', 'aac', 'aba']
- let producer = new HintKeyProducer(charset);
+ const producer = new HintKeyProducer(charset);
for (let i = 0; i < sequences.length; ++i) {
expect(producer.produce()).to.equal(sequences[i]);
}
diff --git a/test/content/usecases/KeymapUseCase.test.ts b/test/content/usecases/KeymapUseCase.test.ts
index 598d5a3..032d4fc 100644
--- a/test/content/usecases/KeymapUseCase.test.ts
+++ b/test/content/usecases/KeymapUseCase.test.ts
@@ -52,7 +52,7 @@ class MockAddressRepository implements AddressRepository {
describe('KeymapUseCase', () => {
context('with no-digis keymaps', () => {
- let settings = Settings.fromJSON({
+ const settings = Settings.fromJSON({
keymaps: {
k: {type: 'scroll.vertically', count: -1},
j: {type: 'scroll.vertically', count: 1},
@@ -88,7 +88,7 @@ describe('KeymapUseCase', () => {
});
context('when keymaps containing numeric mappings', () => {
- let settings = Settings.fromJSON({
+ const settings = Settings.fromJSON({
keymaps: {
20: {type: "scroll.top"},
g5: {type: 'scroll.bottom'},
@@ -132,7 +132,7 @@ describe('KeymapUseCase', () => {
});
context('when the keys are mismatched with the operations', () => {
- let settings = Settings.fromJSON({
+ const settings = Settings.fromJSON({
keymaps: {
gg: {type: "scroll.top"},
G: {type: "scroll.bottom"},
@@ -170,7 +170,7 @@ describe('KeymapUseCase', () => {
});
context('when the site matches to the blacklist', () => {
- let settings = Settings.fromJSON({
+ const settings = Settings.fromJSON({
keymaps: {
k: {type: 'scroll.vertically', count: -1},
a: {type: 'addon.enable'},
@@ -197,7 +197,7 @@ describe('KeymapUseCase', () => {
});
context('when the site matches to the partial blacklist', () => {
- let settings = Settings.fromJSON({
+ const settings = Settings.fromJSON({
keymaps: {
k: {type: 'scroll.vertically', count: -1},
j: {type: 'scroll.vertically', count: 1},
diff --git a/test/content/usecases/SettingUseCaase.test.ts b/test/content/usecases/SettingUseCaase.test.ts
index 136c5af..cf14e6e 100644
--- a/test/content/usecases/SettingUseCaase.test.ts
+++ b/test/content/usecases/SettingUseCaase.test.ts
@@ -38,7 +38,7 @@ describe('AddonEnabledUseCase', () => {
let sut: SettingUseCase;
beforeEach(() => {
- let testSettings = {
+ const testSettings = {
keymaps: {},
search: {
default: 'google',
@@ -61,10 +61,10 @@ describe('AddonEnabledUseCase', () => {
describe('#reload', () => {
it('loads settings and store to repository', async() => {
- let settings = await sut.reload();
+ const settings = await sut.reload();
expect(settings.properties.hintchars).to.equal('abcd1234');
- let saved = repository.get();
+ const saved = repository.get();
expect(saved.properties.hintchars).to.equal('abcd1234');
});
});