Skip to content

Commit 86ee2b3

Browse files
committed
chore: add unit tests and clean up dependencies
1 parent 673f009 commit 86ee2b3

File tree

12 files changed

+5341
-48
lines changed

12 files changed

+5341
-48
lines changed

.mocharc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
reporter: 'spec',
3+
require: './test/unit/mock-setup.js',
4+
spec: ['test/unit/*.test.js'],
5+
};

.nycrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"reporter": ["lcov", "text"]
3+
}

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,31 @@
1717
[download-image]: https://img.shields.io/npm/dm/electron-windows.svg
1818
[download-url]: https://npmjs.org/package/electron-windows
1919

20-
> Manage multiple windows of Electron gracefully and provides powerful features.
20+
> Manage multiple windows of Electron gracefully and provide powerful features.
2121
22-
<!-- GITCONTRIBUTOR_START -->
23-
24-
## Contributors
25-
26-
|[<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars.githubusercontent.com/u/17586742?v=4" width="100px;"/><br/><sub><b>sriting</b></sub>](https://github.com/sriting)<br/>|[<img src="https://avatars.githubusercontent.com/u/52845048?v=4" width="100px;"/><br/><sub><b>snapre</b></sub>](https://github.com/snapre)<br/>|[<img src="https://avatars.githubusercontent.com/u/12660278?v=4" width="100px;"/><br/><sub><b>ColaDaddyz</b></sub>](https://github.com/ColaDaddyz)<br/>|[<img src="https://avatars.githubusercontent.com/u/30524126?v=4" width="100px;"/><br/><sub><b>z0gSh1u</b></sub>](https://github.com/z0gSh1u)<br/>|[<img src="https://avatars.githubusercontent.com/u/4081746?v=4" width="100px;"/><br/><sub><b>zlyi</b></sub>](https://github.com/zlyi)<br/>|
27-
| :---: | :---: | :---: | :---: | :---: | :---: |
28-
[<img src="https://avatars.githubusercontent.com/u/50158871?v=4" width="100px;"/><br/><sub><b>moshangqi</b></sub>](https://github.com/moshangqi)<br/>
29-
30-
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Fri Apr 25 2025 11:40:35 GMT+0800`.
31-
32-
<!-- GITCONTRIBUTOR_END -->
33-
34-
## Installment
22+
## Installation
3523

3624
```bash
3725
$ npm i electron-windows --save
3826
```
3927

4028
## Demo
4129

42-
![](./sceenshot.png)
30+
![](./screenshot.png)
4331

4432
## APIs
4533

4634
### init
4735

4836
```javascript
49-
const WindowManager = require('electron-windows');
50-
const windowManager = new WindowManager();
37+
const WindowManager = require('electron-windows')
38+
const windowManager = new WindowManager()
5139
```
5240

5341
### create
5442

5543
```javascript
56-
const { app } = require('electron');
44+
const { app } = require('electron')
5745
const winRef = windowManager.create({
5846
name: 'window1',
5947
loadingView: {
@@ -73,14 +61,27 @@ const winRef = windowManager.create({
7361
},
7462
openDevTools: true,
7563
storageKey: 'storage-filename', // optional. The name of file. Support storage of window state
76-
storagePath: app.getPath('userData'), // optional. The path of file, only used when storageKey is not empty
77-
});
64+
storagePath: app.getPath('userData'), // optional. The path of file, only used when storageKey is not empty
65+
})
7866
```
7967

80-
## TODO
68+
## Roadmap
8169

8270
- [ ] support storage of window configuration
83-
- [ ] clone pointed window
71+
- [ ] support window cloning
72+
73+
<!-- GITCONTRIBUTOR_START -->
74+
75+
## Contributors
76+
77+
| [<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/> | [<img src="https://avatars.githubusercontent.com/u/17586742?v=4" width="100px;"/><br/><sub><b>sriting</b></sub>](https://github.com/sriting)<br/> | [<img src="https://avatars.githubusercontent.com/u/52845048?v=4" width="100px;"/><br/><sub><b>snapre</b></sub>](https://github.com/snapre)<br/> | [<img src="https://avatars.githubusercontent.com/u/12660278?v=4" width="100px;"/><br/><sub><b>ColaDaddyz</b></sub>](https://github.com/ColaDaddyz)<br/> | [<img src="https://avatars.githubusercontent.com/u/30524126?v=4" width="100px;"/><br/><sub><b>z0gSh1u</b></sub>](https://github.com/z0gSh1u)<br/> | [<img src="https://avatars.githubusercontent.com/u/4081746?v=4" width="100px;"/><br/><sub><b>zlyi</b></sub>](https://github.com/zlyi)<br/> |
78+
| :------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------: |
79+
80+
[<img src="https://avatars.githubusercontent.com/u/50158871?v=4" width="100px;"/><br/><sub><b>moshangqi</b></sub>](https://github.com/moshangqi)<br/>
81+
82+
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Fri Apr 25 2025 11:40:35 GMT+0800`.
83+
84+
<!-- GITCONTRIBUTOR_END -->
8485

8586
## License
8687

lib/helper.js

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

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@
3030
"eslint": "7",
3131
"eslint-config-egg": "12",
3232
"eslint-plugin-mocha": "~10.0.0",
33-
"git-contributor": "*",
34-
"husky": "*",
35-
"mocha": "*",
36-
"nyc": "*"
33+
"git-contributor": "2",
34+
"mocha": "10",
35+
"nyc": "17"
3736
},
3837
"scripts": {
3938
"dev": "electron ./start.js",
40-
"test": "nyc --reporter=lcov --reporter=text mocha",
39+
"pretest": "rm -rf .nyc_output coverage",
40+
"test": "nyc mocha",
4141
"test:e2e": "npx playwright test",
4242
"lint": "eslint . --fix",
4343
"contributor": "git-contributor"
4444
},
45-
"husky": {
46-
"hooks": {
47-
"pre-commit": "npm run lint"
48-
}
49-
},
50-
"license": "MIT"
45+
"license": "MIT",
46+
"pnpm": {
47+
"onlyBuiltDependencies": [
48+
"electron"
49+
]
50+
}
5151
}

0 commit comments

Comments
 (0)