(asar: boolean)
| 7 | import { app, modifyPackageJson } from "./helpers/packTester" |
| 8 | |
| 9 | function createExtraMetadataTest(asar: boolean) { |
| 10 | return app({ |
| 11 | targets: Platform.LINUX.createTarget(DIR_TARGET), |
| 12 | config: coerceTypes({ |
| 13 | asar, |
| 14 | linux: { |
| 15 | executableName: "new-name", |
| 16 | }, |
| 17 | extraMetadata: { |
| 18 | version: "1.0.0-beta.19", |
| 19 | foo: { |
| 20 | bar: 12, |
| 21 | updated: "true", |
| 22 | disabled: "false", |
| 23 | }, |
| 24 | rootKey: "false", |
| 25 | rootKeyT: "true", |
| 26 | rootKeyN: "null", |
| 27 | }, |
| 28 | }), |
| 29 | }, { |
| 30 | projectDirCreated: projectDir => modifyPackageJson(projectDir, data => { |
| 31 | data.scripts = {} |
| 32 | data.devDependencies = {foo: "boo"} |
| 33 | data.foo = { |
| 34 | bar: 42, |
| 35 | existingProp: 22, |
| 36 | } |
| 37 | }), |
| 38 | packed: async context => { |
| 39 | await assertThat(path.join(context.getContent(Platform.LINUX), "new-name")).isFile() |
| 40 | if (asar) { |
| 41 | expect(await readAsarJson(path.join(context.getResources(Platform.LINUX), "app.asar"), "package.json")).toMatchSnapshot() |
| 42 | } |
| 43 | else { |
| 44 | expect(await readJson(path.join(context.getResources(Platform.LINUX), "app", "package.json"))).toMatchSnapshot() |
| 45 | } |
| 46 | } |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | test.ifDevOrLinuxCi("extra metadata", createExtraMetadataTest(true)) |
| 51 | test.ifDevOrLinuxCi("extra metadata (no asar)", createExtraMetadataTest(false)) |
no test coverage detected
searching dependent graphs…