Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit f3f83ed

Browse files
committed
more reorg
1 parent bffca7b commit f3f83ed

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// Webpack uses MiniCssExtractPlugin when it sees this.
77
import './scss/app.scss';
88

9-
import { grayTabby } from './app/ui';
9+
import { graytabby } from './app/ui';
1010
import { PAGE_LOAD } from './lib/globals';
1111

12-
grayTabby().then(
12+
graytabby().then(
1313
() => {
1414
PAGE_LOAD.get()
1515
.pub()

src/app/ui.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ declare global {
279279
/**
280280
* The main entry point for GrayTabby.
281281
*/
282-
export async function grayTabby(): Promise<void> {
282+
export async function graytabby(): Promise<void> {
283283
DOCUMENT.get().title = 'GrayTabby';
284284
await bindOptions();
285285
const groupsNode = <HTMLDivElement>DOCUMENT.get().querySelector('#groups');

tests/archive.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { archivePlan } from '../src/bg/archive';
44
import { Broker, BrokerConsumer } from '../src/lib/brokers';
55
import { ARCHIVAL, DOCUMENT } from '../src/lib/globals';
66
import { dateFromKey, INDEX_V2_KEY } from '../src/app/tabs';
7-
import { assertElement, initGrayTabby, testTab, stubGlobals, unstubGlobals } from './utils';
7+
import { assertElement, testTab, stubGlobals, unstubGlobals } from './utils';
88
import { BrowserTab } from '../src/lib/types';
9+
import { graytabby } from '../src/app/ui';
910

1011
describe('archive operation', function() {
1112
beforeEach(async function() {
@@ -25,7 +26,7 @@ describe('archive operation', function() {
2526
consumer = func;
2627
};
2728
ARCHIVAL.set(archival);
28-
await initGrayTabby();
29+
await graytabby();
2930
assertElement('#groups > div', DOCUMENT.get(), 0);
3031

3132
consumer([testTab({ url: 'http://example.com' })], {}, () => null);

tests/grayTabby.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { initGrayTabby, stubGlobals, unstubGlobals } from './utils';
1+
import { stubGlobals, unstubGlobals } from './utils';
22
import { bindArchivalHandlers } from '../src/bg/archive';
3+
import { graytabby } from '../src/app/ui';
34

45
describe('graytabby', function() {
56
beforeEach(async function() {
@@ -11,7 +12,7 @@ describe('graytabby', function() {
1112
});
1213

1314
it('frontend should attach to dom without throwing', async () => {
14-
await initGrayTabby();
15+
await graytabby();
1516
});
1617

1718
it('backend should register handlers without throwing', async () => {

tests/utils.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22
import { JSDOM } from 'jsdom';
33
import * as mockBrowser from 'sinon-chrome';
44
import { INDEX_V1_KEY, INDEX_V2_KEY } from '../src/app/tabs';
5-
import { grayTabby } from '../src/app/ui';
5+
import { graytabby } from '../src/app/ui';
66
import { BROWSER, DOCUMENT } from '../src/lib/globals';
77
import { OPTIONS_KEY } from '../src/lib/options';
88
import { BrowserTab } from '../src/lib/types';
@@ -22,14 +22,6 @@ export function unstubGlobals(): void {
2222
DOCUMENT.set(null);
2323
}
2424

25-
export async function initGrayTabby(): Promise<void> {
26-
try {
27-
return await grayTabby();
28-
} catch (err) {
29-
expect.fail('Uncaught error: ' + err);
30-
}
31-
}
32-
3325
export function testTab(args: Partial<BrowserTab>): BrowserTab {
3426
return {
3527
index: 1,

0 commit comments

Comments
 (0)