electron-info 1.25.1 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
3
4
|
import { expect, describe, test, beforeEach, beforeAll, afterAll, afterEach } from 'vitest';
|
|
4
5
|
import { StatusCodes as HTTP_STATUS } from 'http-status-codes';
|
|
5
6
|
import nock from 'nock';
|
|
6
|
-
import fs from 'fs-extra';
|
|
7
7
|
import { ElectronInfo } from './ElectronInfo.js';
|
|
8
8
|
const __dirname = import.meta.dirname;
|
|
9
9
|
const tempDir = path.resolve(__dirname, '.temp');
|
|
@@ -26,18 +26,21 @@ const createRandomBody = () => [
|
|
|
26
26
|
},
|
|
27
27
|
];
|
|
28
28
|
const provideReleaseFile = async () => {
|
|
29
|
-
await fs.
|
|
29
|
+
await fs.cp(fullReleasesFile, path.join(tempDirDownload, 'latest.json'));
|
|
30
30
|
};
|
|
31
31
|
describe('ElectronInfo', () => {
|
|
32
32
|
let releases;
|
|
33
33
|
beforeAll(async () => {
|
|
34
|
-
|
|
34
|
+
try {
|
|
35
|
+
await fs.mkdir(tempDir);
|
|
36
|
+
}
|
|
37
|
+
catch (_a) { }
|
|
35
38
|
releases = await fs.readFile(fullReleasesFile, 'utf8');
|
|
36
39
|
});
|
|
37
40
|
beforeEach(() => {
|
|
38
41
|
nock(mockUrl).get('/').reply(HTTP_STATUS.OK, releases);
|
|
39
42
|
});
|
|
40
|
-
afterAll(() => fs.
|
|
43
|
+
afterAll(() => fs.rm(tempDir, { force: true, recursive: true }));
|
|
41
44
|
afterEach(() => nock.cleanAll());
|
|
42
45
|
describe('getElectronReleases', () => {
|
|
43
46
|
test('parses Electron versions', async () => {
|
package/package.json
CHANGED
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"description": "Get useful data about Electron releases.",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/fs-extra": "11.0.4",
|
|
16
15
|
"@types/semver": "7.7.1",
|
|
17
|
-
"fs-extra": "11.3.2",
|
|
18
16
|
"http-status-codes": "2.3.0",
|
|
19
17
|
"nock": "14.0.10",
|
|
20
18
|
"rimraf": "6.1.0",
|
|
@@ -49,6 +47,6 @@
|
|
|
49
47
|
"test": "vitest run"
|
|
50
48
|
},
|
|
51
49
|
"type": "module",
|
|
52
|
-
"version": "1.
|
|
53
|
-
"gitHead": "
|
|
50
|
+
"version": "1.26.1",
|
|
51
|
+
"gitHead": "eedb2984fd69190a0b69a992d18fe451e714e04d"
|
|
54
52
|
}
|