Skip to content

Commit 2ee2e6a

Browse files
authored
ci: Add lint and test jobs (#367)
* ci: Add lint and test jobs * Fix tests and lint * Fix lint * Fix tests * Only one job
1 parent 3c4e5ab commit 2ee2e6a

File tree

7 files changed

+55
-39
lines changed

7 files changed

+55
-39
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
time: "02:00"
8+
timezone: Europe/Berlin
9+
open-pull-requests-limit: 10

.github/workflows/pr.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
lint-and-test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- run: yarn install
17+
- run: yarn lint
18+
- run: yarn test

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@
6060
"peerDependencies": {
6161
"electron": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0"
6262
}
63-
}
63+
}

src/Menubar.spec.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,33 @@ describe('Menubar', () => {
1515
expect(mb!.app).toBeDefined();
1616
});
1717

18-
it('should have property `positioner`', (done) => {
18+
it('should have property `positioner`', () => {
1919
expect(() => mb!.positioner as unknown).toThrow();
20-
mb!.on('after-create-window', () => {
21-
expect(mb!.positioner).toBeDefined();
22-
done();
20+
return new Promise<void>((resolve) => {
21+
mb!.on('after-create-window', () => {
22+
expect(mb!.positioner).toBeDefined();
23+
resolve();
24+
});
2325
});
2426
});
2527

26-
it('should have property `tray`', (done) => {
28+
it('should have property `tray`', () => {
2729
expect(() => mb!.tray).toThrow();
28-
mb!.on('ready', () => {
29-
expect(mb!.tray).toBeInstanceOf(Tray);
30-
done();
30+
return new Promise<void>((resolve) => {
31+
mb!.on('ready', () => {
32+
expect(mb!.tray).toBeInstanceOf(Tray);
33+
resolve();
34+
});
3135
});
3236
});
3337

34-
it('should have property `window`', (done) => {
38+
it('should have property `window`', () => {
3539
expect(mb!.window).toBeUndefined();
36-
mb!.on('ready', () => {
37-
expect(mb!.window).toBeInstanceOf(BrowserWindow);
38-
done();
40+
return new Promise<void>((resolve) => {
41+
mb!.on('ready', () => {
42+
expect(mb!.window).toBeInstanceOf(BrowserWindow);
43+
resolve();
44+
});
3945
});
4046
});
4147
});

src/util/cleanOptions.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { MOCK_APP_GETAPPPATH } from '../__mocks__/electron';
44
import { cleanOptions } from './cleanOptions';
55

66
const DEFAULT_OPTIONS = {
7+
activateWithApp: true,
78
browserWindow: {
89
height: 400,
910
width: 400,

tsconfig.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"extends": "./node_modules/@amaurym/tsconfig/tsconfig",
3-
"compilerOptions": {
4-
"declaration": true,
5-
"module": "commonjs",
6-
"outDir": "./lib",
7-
"target": "es5"
8-
}
2+
"extends": "./node_modules/@amaurym/tsconfig/tsconfig",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"module": "commonjs",
6+
"outDir": "./lib",
7+
"skipLibCheck": true,
8+
"target": "es5"
9+
}
910
}

0 commit comments

Comments
 (0)