diff --git a/.circleci/config.yml b/.circleci/config.yml index b32b1ef9..c50207b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 orbs: cfa: continuousauth/npm@2.1.0 - node: electronjs/node@1.4.1 + node: electronjs/node@2.1.0 jobs: test: diff --git a/test/asar.js b/test/asar.js index 3a05cca6..bd73b8c0 100644 --- a/test/asar.js +++ b/test/asar.js @@ -85,6 +85,6 @@ test.serial('prebuilt asar', util.testSinglePlatform(async (t, opts) => { await util.assertPathNotExists(t, path.join(resourcesPath, 'app'), 'app subdirectory should NOT exist when app.asar is built') })) -test('prebuiltAsar: fail when set to directory', failedPrebuiltAsarTest({ prebuiltAsar: util.fixtureSubdir('asar-prebuilt') }, /must be an asar file/)) -test('prebuiltAsar: fail when specifying afterCopy', incompatibleOptionWithPrebuiltAsarTest({ afterCopy: [] })) -test('prebuiltAsar: fail when specifying afterPrune', incompatibleOptionWithPrebuiltAsarTest({ afterPrune: [] })) +test.serial('prebuiltAsar: fail when set to directory', failedPrebuiltAsarTest({ prebuiltAsar: util.fixtureSubdir('asar-prebuilt') }, /must be an asar file/)) +test.serial('prebuiltAsar: fail when specifying afterCopy', incompatibleOptionWithPrebuiltAsarTest({ afterCopy: [] })) +test.serial('prebuiltAsar: fail when specifying afterPrune', incompatibleOptionWithPrebuiltAsarTest({ afterPrune: [] })) diff --git a/test/config.json b/test/config.json index 073c4f99..15bc0ab6 100644 --- a/test/config.json +++ b/test/config.json @@ -1,3 +1,3 @@ { - "version": "1.4.13" + "version": "27.0.0" } diff --git a/test/darwin.js b/test/darwin.js index 2420eadb..b4983c22 100644 --- a/test/darwin.js +++ b/test/darwin.js @@ -73,7 +73,7 @@ async function assertHelper (t, prefix, appName, helperSuffix) { } async function helperAppPathsTest (t, baseOpts, extraOpts, expectedName) { - const opts = { ...baseOpts, ...extraOpts } + const opts = { ...baseOpts, ...extraOpts, electronVersion: '1.4.13' } if (!expectedName) { expectedName = opts.name @@ -170,6 +170,8 @@ async function appBundleTest (t, opts, appBundleId) { } async function appHelpersBundleTest (t, opts, helperBundleId, appBundleId) { + opts.electronVersion = '1.4.13' + if (helperBundleId) { opts.helperBundleId = helperBundleId } @@ -488,11 +490,11 @@ if (!(process.env.CI && process.platform === 'win32')) { const finalPath = (await packager(opts))[0] const plistObj = await parseInfoPlist(t, opts, finalPath) t.is(typeof plistObj.ElectronAsarIntegrity, 'object') - // Note: If updating thr basic app fixture (used here in baseOpts), ths hash should also be updated. + // Note: If updating the basic app fixture (used here in baseOpts), ths hash should also be updated. t.deepEqual(plistObj.ElectronAsarIntegrity, { 'Resources/app.asar': { algorithm: 'SHA256', - hash: '4fcfc041675bfbad16cb6c3c4acfa339cd59e891944a27bc9e64076635f1825a' + hash: '2ec82b43414573ce1414a09859d6d30d1fc8bcbd0b33b404125f557e18d3b536' } }) })) diff --git a/test/fixtures/asar-prebuilt/node_modules/electron/package.json b/test/fixtures/asar-prebuilt/node_modules/electron/package.json index bcf3fc69..a6b7e2c7 100644 --- a/test/fixtures/asar-prebuilt/node_modules/electron/package.json +++ b/test/fixtures/asar-prebuilt/node_modules/electron/package.json @@ -1,4 +1,4 @@ { - "version": "1.4.13", + "version": "27.0.0", "main": "index.js" } diff --git a/test/fixtures/asar-prebuilt/package.json b/test/fixtures/asar-prebuilt/package.json index d8dca106..0d8e57dc 100644 --- a/test/fixtures/asar-prebuilt/package.json +++ b/test/fixtures/asar-prebuilt/package.json @@ -4,6 +4,6 @@ "description": "A prebuilt asar app", "main": "main.js", "devDependencies": { - "electron": "1.4.13" + "electron": "27.0.0" } } diff --git a/test/fixtures/basic/node_modules/electron/package.json b/test/fixtures/basic/node_modules/electron/package.json index bcf3fc69..a6b7e2c7 100644 --- a/test/fixtures/basic/node_modules/electron/package.json +++ b/test/fixtures/basic/node_modules/electron/package.json @@ -1,4 +1,4 @@ { - "version": "1.4.13", + "version": "27.0.0", "main": "index.js" } diff --git a/test/fixtures/basic/package.json b/test/fixtures/basic/package.json index 4c640b64..c936b447 100644 --- a/test/fixtures/basic/package.json +++ b/test/fixtures/basic/package.json @@ -11,7 +11,7 @@ "devDependencies": { "ncp": "^2.0.0", "run-waterfall": "^1.1.1", - "electron": "1.4.13", + "electron": "27.0.0", "ffi-napi": "4.0.3" } } diff --git a/test/fixtures/electron-in-dependencies/node_modules/electron/package.json b/test/fixtures/electron-in-dependencies/node_modules/electron/package.json index aac6e0e8..1bbb6d73 100644 --- a/test/fixtures/electron-in-dependencies/node_modules/electron/package.json +++ b/test/fixtures/electron-in-dependencies/node_modules/electron/package.json @@ -1,5 +1,5 @@ { "name": "electron", - "version": "1.4.13", + "version": "27.0.0", "main": "index.js" } diff --git a/test/fixtures/electron-in-dependencies/package.json b/test/fixtures/electron-in-dependencies/package.json index bd7e3e2c..f8e1ffb1 100644 --- a/test/fixtures/electron-in-dependencies/package.json +++ b/test/fixtures/electron-in-dependencies/package.json @@ -3,6 +3,6 @@ "productName": "MainJS", "description": "Removing electron from dependencies", "dependencies": { - "electron": "1.4.13" + "electron": "27.0.0" } } diff --git a/test/fixtures/infer-missing-version-only/node_modules/electron/package.json b/test/fixtures/infer-missing-version-only/node_modules/electron/package.json index bcf3fc69..a6b7e2c7 100644 --- a/test/fixtures/infer-missing-version-only/node_modules/electron/package.json +++ b/test/fixtures/infer-missing-version-only/node_modules/electron/package.json @@ -1,4 +1,4 @@ { - "version": "1.4.13", + "version": "27.0.0", "main": "index.js" } diff --git a/test/fixtures/infer-missing-version-only/package.json b/test/fixtures/infer-missing-version-only/package.json index 802a553f..d89dea64 100644 --- a/test/fixtures/infer-missing-version-only/package.json +++ b/test/fixtures/infer-missing-version-only/package.json @@ -2,6 +2,6 @@ "main": "main.js", "productName": "MainJS", "devDependencies": { - "electron": "1.4.13" + "electron": "27.0.0" } } diff --git a/test/hooks.js b/test/hooks.js index 4a624bf5..f7bf3c4e 100644 --- a/test/hooks.js +++ b/test/hooks.js @@ -9,7 +9,7 @@ const util = require('./_util') async function hookTest (wantHookCalled, hookName, t, opts, validator) { let hookCalled = false opts.dir = util.fixtureSubdir('basic') - opts.electronVersion = config.version + opts.electronVersion = '1.4.13' opts.arch = 'ia32' opts.platform = 'all' diff --git a/test/targets.js b/test/targets.js index 5a748e01..12f6a81c 100644 --- a/test/targets.js +++ b/test/targets.js @@ -80,10 +80,10 @@ test('build for all available official targets', testMultiTarget({ all: true, electronVersion: '1.8.2' }, util.allPlatformArchCombosCount - 5, 'Packages should be generated for all possible platforms (except win32/arm64)')) test('build for all available official targets for a version without arm64 or mips64el support', - testMultiTarget({ all: true }, util.allPlatformArchCombosCount - 7, + testMultiTarget({ all: true, electronVersion: '1.4.13' }, util.allPlatformArchCombosCount - 7, 'Packages should be generated for all possible platforms (except linux/arm64, linux/mips64el, or win32/arm64)')) test('platform=all (one arch)', - testMultiTarget({ arch: 'ia32', platform: 'all' }, 2, 'Packages should be generated for both 32-bit platforms')) + testMultiTarget({ arch: 'ia32', platform: 'all', electronVersion: '1.4.13' }, 2, 'Packages should be generated for both 32-bit platforms')) test('arch=all (one platform)', testMultiTarget({ arch: 'all', platform: 'linux' }, 3, 'Packages should be generated for all expected architectures')) @@ -103,8 +103,8 @@ test('fails with invalid platform', util.invalidOptionTest({ test('invalid official combination', testMultiTarget({ arch: 'ia32', platform: 'darwin' }, 0, 'Package should not be generated for invalid official combination')) test('platform=linux and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'linux', electronVersion: '1.8.0' }, 1, 'Package should be generated for linux/arm64')) -test('platform=linux and arch=arm64 with a supported official Electron version (11.0.0-beta.22)', testMultiTarget({ arch: 'arm64', platform: 'linux', electronVersion: '11.0.0-beta.22' }, 1, 'Package should be generated for linux/arm64')) -test('platform=linux and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'linux' }, 0, 'Package should not be generated for linux/arm64')) +test('platform=linux and arch=arm64 with a supported official Electron version (11.0.0-beta.22)', testMultiTarget({ arch: 'arm64', platform: 'linux' }, 1, 'Package should be generated for linux/arm64')) +test('platform=linux and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'linux', electronVersion: '1.4.13' }, 0, 'Package should not be generated for linux/arm64')) test('platform=linux and arch=ia32 with a supported official Electron version', testMultiTarget({ arch: 'ia32', platform: 'linux', electronVersion: '10.0.0' }, 1, 'Package should be generated for linux/ia32')) test('platform=linux and arch=ia32 with an unsupported official Electron version (19.0.0-beta.1)', testMultiTarget({ arch: 'ia32', platform: 'linux', electronVersion: '19.0.0-beta.1' }, 0, 'Package should not be generated for linux/ia32')) @@ -114,20 +114,20 @@ test('platform=linux and arch=mips64el with a supported official Electron versio test('platform=linux and arch=mips64el with an unsupported official Electron version', testMultiTarget({ arch: 'mips64el', platform: 'linux' }, 0, 'Package should not be generated for linux/mips64el')) test('platform=linux and arch=mips64el with an unsupported official Electron version (2.0.0)', testMultiTarget({ arch: 'mips64el', platform: 'linux', electronVersion: '2.0.0' }, 0, 'Package should not be generated for linux/mips64el')) -test('platform=win32 and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'win32', electronVersion: '6.0.8' }, 1, 'Package should be generated for win32/arm64')) -test('platform=win32 and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'win32' }, 0, 'Package should not be generated for win32/arm64')) +test('platform=win32 and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'win32' }, 1, 'Package should be generated for win32/arm64')) +test('platform=win32 and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'win32', electronVersion: '1.4.13' }, 0, 'Package should not be generated for win32/arm64')) -test('platform=darwin and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'darwin', electronVersion: '11.0.0-beta.5' }, 1, 'Package should be generated for darwin/arm64')) -test('platform=darwin and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'darwin' }, 0, 'Package should not be generated for darwin/arm64')) +test('platform=darwin and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'darwin' }, 1, 'Package should be generated for darwin/arm64')) +test('platform=darwin and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'darwin', electronVersion: '1.4.13' }, 0, 'Package should not be generated for darwin/arm64')) -test('platform=mas and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'mas', electronVersion: '11.0.0-beta.5' }, 1, 'Package should be generated for mas/arm64')) -test('platform=mas and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'mas' }, 0, 'Package should not be generated for mas/arm64')) +test('platform=mas and arch=arm64 with a supported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'mas' }, 1, 'Package should be generated for mas/arm64')) +test('platform=mas and arch=arm64 with an unsupported official Electron version', testMultiTarget({ arch: 'arm64', platform: 'mas', electronVersion: '1.4.13' }, 0, 'Package should not be generated for mas/arm64')) -test('platform=darwin and arch=universal with a supported official Electron version', testMultiTarget({ arch: 'universal', platform: 'darwin', electronVersion: '11.0.0-beta.5' }, 1, 'Package should be generated for darwin/universal')) -test('platform=darwin and arch=universal with an unsupported official Electron version', testMultiTarget({ arch: 'universal', platform: 'darwin' }, 0, 'Package should not be generated for darwin/universal')) +test('platform=darwin and arch=universal with a supported official Electron version', testMultiTarget({ arch: 'universal', platform: 'darwin' }, 1, 'Package should be generated for darwin/universal')) +test('platform=darwin and arch=universal with an unsupported official Electron version', testMultiTarget({ arch: 'universal', platform: 'darwin', electronVersion: '1.4.13' }, 0, 'Package should not be generated for darwin/universal')) -test('platform=mas and arch=universal with a supported official Electron version', testMultiTarget({ arch: 'universal', platform: 'mas', electronVersion: '11.0.0-beta.5' }, 1, 'Package should be generated for mas/universal')) -test('platform=mas and arch=universal with an unsupported official Electron version', testMultiTarget({ arch: 'universal', platform: 'mas' }, 0, 'Package should not be generated for mas/universal')) +test('platform=mas and arch=universal with a supported official Electron version', testMultiTarget({ arch: 'universal', platform: 'mas' }, 1, 'Package should be generated for mas/universal')) +test('platform=mas and arch=universal with an unsupported official Electron version', testMultiTarget({ arch: 'universal', platform: 'mas', electronVersion: '1.4.13' }, 0, 'Package should not be generated for mas/universal')) test('unofficial arch', testMultiTarget({ arch: 'z80', platform: 'linux', download: { mirrorOptions: { mirror: 'mirror' } } }, 1, 'Package should be generated for non-standard arch from non-official mirror'))