mirror of
https://github.com/captn3m0/which-electron.git
synced 2024-09-27 19:22:53 +00:00
Adds tests for version finder
This commit is contained in:
parent
ca9c6ecf25
commit
50de21a2de
@ -1,30 +1,48 @@
|
||||
const test = require('kuta').test;
|
||||
const finder = require('../finder')
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const test = require("kuta").test;
|
||||
const finder = require("../finder");
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
|
||||
function getEntries(fn) {
|
||||
return JSON.parse(fs.readFileSync(`./tests/fixtures/${fn}.json`))
|
||||
return JSON.parse(fs.readFileSync(`./tests/fixtures/${fn}.json`));
|
||||
}
|
||||
|
||||
test('it should find the electron.asar file', ()=> {
|
||||
test("it should find the electron.asar file", () => {
|
||||
assert.deepEqual(
|
||||
['Hyper.app/Contents/Resources/electron.asar'],
|
||||
finder.asar(getEntries('Hyper-3.0.2-mac.zip'))
|
||||
)
|
||||
["Hyper.app/Contents/Resources/electron.asar"],
|
||||
finder.asar(getEntries("Hyper-3.0.2-mac.zip"))
|
||||
);
|
||||
});
|
||||
|
||||
test('it should find the correct binary file', () => {
|
||||
test("it should find the correct binary file", () => {
|
||||
assert.deepEqual(
|
||||
'Hyper.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework',
|
||||
finder.binary(getEntries('Hyper-3.0.2-mac.zip'))
|
||||
)
|
||||
"Hyper.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework",
|
||||
finder.binary(getEntries("Hyper-3.0.2-mac.zip"))
|
||||
);
|
||||
assert.deepEqual(
|
||||
'Notable.exe',
|
||||
finder.binary(getEntries('Notable-1.8.4-win.zip'))
|
||||
)
|
||||
"Notable.exe",
|
||||
finder.binary(getEntries("Notable-1.8.4-win.zip"))
|
||||
);
|
||||
assert.deepEqual(
|
||||
'rambox',
|
||||
finder.binary(getEntries('Rambox-0.7.7-linux-x64.zip'))
|
||||
)
|
||||
})
|
||||
"rambox",
|
||||
finder.binary(getEntries("Rambox-0.7.7-linux-x64.zip"))
|
||||
);
|
||||
});
|
||||
|
||||
test("it should find the version file", () => {
|
||||
assert.deepEqual(
|
||||
["chronobreak-linux-x64/version"],
|
||||
finder.version(getEntries("chronobreak-linux-x64.zip"))
|
||||
);
|
||||
assert.deepEqual(
|
||||
["release-builds/encrypt0r-darwin-x64/version"],
|
||||
finder.version(getEntries("encrypt0r-mac.zip"))
|
||||
);
|
||||
assert.deepEqual(
|
||||
[
|
||||
"Arizona v.1.0.0/resources/app/node_modules/electron/dist/version",
|
||||
"Arizona v.1.0.0/version",
|
||||
],
|
||||
finder.version(getEntries("Arizona-v1.0.0-beta-Windows.zip"))
|
||||
);
|
||||
});
|
||||
|
1
tests/fixtures/Arizona-v1.0.0-beta-Windows.zip.json
vendored
Normal file
1
tests/fixtures/Arizona-v1.0.0-beta-Windows.zip.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/chronobreak-linux-x64.zip.json
vendored
Normal file
1
tests/fixtures/chronobreak-linux-x64.zip.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/encrypt0r-mac.zip.json
vendored
Normal file
1
tests/fixtures/encrypt0r-mac.zip.json
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user