diff --git a/appveyor.yml b/appveyor.yml index 15a52064e23..08b8f197542 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,14 +2,11 @@ platform: - x64 cache: - - node_modules - - '%APPDATA%\npm-cache' - '%USERPROFILE%\.electron' - '%USERPROFILE%\.cache\nsis' install: - ps: Install-Product node 6 x64 - - npm install npm -g - npm install - npm prune diff --git a/package.json b/package.json index 040aeae22e4..9ff176fa6ee 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,6 @@ "diff": "^2.2.3", "json8": "^0.9.2", "pre-git": "^3.10.0", - "should": "^10.0.0", "ts-babel": "^1.0.4", "tslint": "3.14.0", "typescript": "^2.1.0-dev.20160802", diff --git a/src/targets/archive.ts b/src/targets/archive.ts index bd56beeda02..50013a99474 100644 --- a/src/targets/archive.ts +++ b/src/targets/archive.ts @@ -1,4 +1,4 @@ -import { spawn, debug, debug7zArgs } from "../util/util" +import { spawn, debug7zArgs } from "../util/util" import { CompressionLevel } from "../metadata" import * as path from "path" import { unlink } from "fs-extra-p" @@ -34,7 +34,6 @@ export async function archiveApp(compression: CompressionLevel | n, format: stri await spawn(process.platform === "darwin" || process.platform === "freebsd" ? "gtar" : "tar", [info.flag, "--transform", `s,^\.,${path.basename(outFile, "." + format)},`, "-cf", outFile, "."], { cwd: dirToArchive, - stdio: ["ignore", debug.enabled ? "inherit" : "ignore", "inherit"], env: tarEnv }) return outFile @@ -74,7 +73,6 @@ export async function archiveApp(compression: CompressionLevel | n, format: stri await spawn(path7za, args, { cwd: withoutDir ? dirToArchive : path.dirname(dirToArchive), - stdio: ["ignore", debug.enabled ? "inherit" : "ignore", "inherit"], }) return outFile diff --git a/src/targets/nsis.ts b/src/targets/nsis.ts index e37d6972ddd..bf48d85d213 100644 --- a/src/targets/nsis.ts +++ b/src/targets/nsis.ts @@ -233,9 +233,8 @@ export default class NsisTarget extends Target { // we use NSIS_CONFIG_CONST_DATA_PATH=no to build makensis on Linux, but in any case it doesn't use stubs as MacOS/Windows version, so, we explicitly set NSISDIR env: Object.assign({}, process.env, {NSISDIR: nsisPath}), cwd: nsisTemplatesDir, - stdio: ["pipe", "pipe", process.stderr] - }) - handleProcess("close", childProcess, command, resolve, reject, true) + }, true) + handleProcess("close", childProcess, command, resolve, reject) childProcess.stdin.end(script) }) diff --git a/src/util/binDownload.ts b/src/util/binDownload.ts index 5868e8974d3..09ef083ed4a 100644 --- a/src/util/binDownload.ts +++ b/src/util/binDownload.ts @@ -56,7 +56,6 @@ async function doGetBin(name: string, dirName: string, url: string, sha2?: strin await spawn(path7za, debug7zArgs("x").concat(archiveName, `-o${tempUnpackDir}`), { cwd: cachePath, - stdio: ["ignore", debug.enabled ? "inherit" : "ignore", "inherit"], }) const isOldMethod = sha2 == null diff --git a/src/util/util.ts b/src/util/util.ts index f19d364b7ef..a558ebce76e 100644 --- a/src/util/util.ts +++ b/src/util/util.ts @@ -42,7 +42,6 @@ export function spawnNpmProduction(command: string, appDir: string, env?: any): return spawn(npmExecPath, npmExecArgs, { cwd: appDir, - stdio: ["ignore", "pipe", process.stderr], env: env || process.env }) } @@ -98,25 +97,31 @@ export function exec(file: string, args?: Array | null, options?: ExecOp }) } -export function doSpawn(command: string, args: Array, options?: SpawnOptions): ChildProcess { +export function doSpawn(command: string, args: Array, options?: SpawnOptions, pipeInput?: Boolean): ChildProcess { + if (options == null) { + options = {} + } + if (options.stdio == null) { + options.stdio = [pipeInput ? "pipe" : "ignore", debug.enabled ? "inherit" : "pipe", "inherit"] + } + if (debug.enabled) { debug(`Spawning ${command} ${args.join(" ")}`) } return _spawn(command, args, options) } -export function spawn(command: string, args?: Array | null, options?: SpawnOptions): BluebirdPromise { +export function spawn(command: string, args?: Array | null, options?: SpawnOptions, pipeInput?: Boolean): BluebirdPromise { return new BluebirdPromise((resolve, reject) => { - handleProcess("close", doSpawn(command, args || [], options), command, resolve, reject) + handleProcess("close", doSpawn(command, args || [], options, pipeInput), command, resolve, reject) }) } -export function handleProcess(event: string, childProcess: ChildProcess, command: string, resolve: ((value?: any) => void) | null, reject: (reason?: any) => void, printOut: boolean = false) { +export function handleProcess(event: string, childProcess: ChildProcess, command: string, resolve: ((value?: any) => void) | null, reject: (reason?: any) => void) { childProcess.on("error", reject) - let out: string | null = null - if (printOut) { - out = "" + let out = "" + if (!debug.enabled && childProcess.stdout != null) { childProcess.stdout.on("data", (data: string) => { out += data }) @@ -125,11 +130,10 @@ export function handleProcess(event: string, childProcess: ChildProcess, command childProcess.on(event, (code: number) => { if (code === 0 && debug.enabled) { debug(`${command} (${childProcess.pid}) exited with code ${code}`) - debug(out) } if (code !== 0) { - reject(new Error(`${command} exited with code ${code}${out == null ? "" : `\n${out}`}`)) + reject(new Error(`${command} exited with code ${code}${out.length === 0 ? "" : `\n${out}`}`)) } else if (resolve != null) { resolve() diff --git a/src/windowsCodeSign.ts b/src/windowsCodeSign.ts index 9b33c4744f2..eacffafd07f 100644 --- a/src/windowsCodeSign.ts +++ b/src/windowsCodeSign.ts @@ -98,9 +98,7 @@ async function spawnSign(options: any, inputPath: string, outputPath: string, ha args.push(inputPath) } - return await spawn(await getToolPath(options), args, { - stdio: ["ignore", "ignore", "inherit"], - }) + return await spawn(await getToolPath(options), args) } // async function verify(options: any) { diff --git a/test/fixtures/test-app-one/package.json b/test/fixtures/test-app-one/package.json index 7a1a326c52c..648e82f0db1 100755 --- a/test/fixtures/test-app-one/package.json +++ b/test/fixtures/test-app-one/package.json @@ -8,7 +8,7 @@ "author": "Foo Bar ", "license": "MIT", "build": { - "electronVersion": "1.3.1", + "electronVersion": "1.3.2", "appId": "org.electron-builder.testApp", "app-category-type": "your.app.category.type", "iconUrl": "https://raw.githubusercontent.com/szwacz/electron-boilerplate/master/resources/windows/icon.ico", diff --git a/test/src/ArtifactPublisherTest.ts b/test/src/ArtifactPublisherTest.ts index d9321135175..ea358278039 100644 --- a/test/src/ArtifactPublisherTest.ts +++ b/test/src/ArtifactPublisherTest.ts @@ -2,7 +2,7 @@ import test from "./helpers/avaEx" import { GitHubPublisher } from "out/publish/gitHubPublisher" import { HttpError } from "out/publish/gitHubRequest" import { join } from "path" -import * as assertThat from "should/as-function" +import { assertThat } from "./helpers/fileAssert" import { BintrayPublisher } from "out/publish/BintrayPublisher" //noinspection JSUnusedLocalSymbols @@ -16,6 +16,7 @@ function versionNumber() { return `${getRandomInt(0, 99)}.${getRandomInt(0, 99)}.${getRandomInt(0, 99)}` } +//noinspection SpellCheckingInspection const token = new Buffer("Y2Y5NDdhZDJhYzJlMzg1OGNiNzQzYzcwOWZhNGI0OTk2NWQ4ZDg3Yg==", "base64").toString() const iconPath = join(__dirname, "..", "fixtures", "test-app", "build", "icon.icns") @@ -51,6 +52,7 @@ function testAndIgnoreApiRate(name: string, testFunction: () => Promise) { test("Bintray upload", async () => { const version = versionNumber() + //noinspection SpellCheckingInspection const publisher = new BintrayPublisher("actperepo", "5df2cadec86dff91392e4c419540785813c3db15", version, "test") try { const artifactName = `icon-${version}.icns` @@ -85,7 +87,7 @@ testAndIgnoreApiRate("prerelease", async () => { try { await publisher.upload(iconPath) const r = await publisher.getRelease() - assertThat(r).has.properties({ + assertThat(r).hasProperties({ prerelease: true, draft: false, }) diff --git a/test/src/CodeSignTest.ts b/test/src/CodeSignTest.ts index 8acf113f58f..393a47e011e 100644 --- a/test/src/CodeSignTest.ts +++ b/test/src/CodeSignTest.ts @@ -1,5 +1,5 @@ import { createKeychain, deleteKeychain, generateKeychainName } from "out/codeSign" -import * as assertThat from "should/as-function" +import { assertThat } from "./helpers/fileAssert" import test from "./helpers/avaEx" import { CSC_LINK } from "./helpers/codeSignData" import { executeFinally, all } from "out/util/promise" @@ -8,23 +8,28 @@ import { removePassword } from "out/util/util" //noinspection JSUnusedLocalSymbols const __awaiter = require("out/util/awaiter") -test.ifOsx("create keychain", async () => { - const keychainName = generateKeychainName() - await executeFinally(createKeychain(keychainName, CSC_LINK, process.env.CSC_KEY_PASSWORD) - .then(result => { - assertThat(result.keychainName).not.empty() - }), () => all([deleteKeychain(keychainName)])) -}) +if (process.env.CSC_KEY_PASSWORD == null) { + console.warn("Skip keychain-specific tests because CSC_KEY_PASSWORD is not defined") +} +else { + test.ifOsx("create keychain", async() => { + const keychainName = generateKeychainName() + await executeFinally(createKeychain(keychainName, CSC_LINK, process.env.CSC_KEY_PASSWORD) + .then(result => { + assertThat(result.keychainName).isNotEmpty() + }), () => all([deleteKeychain(keychainName)])) + }) -test.ifOsx("create keychain with installers", async () => { - const keychainName = generateKeychainName() - await executeFinally(createKeychain(keychainName, CSC_LINK, process.env.CSC_KEY_PASSWORD) - .then(result => { - assertThat(result.keychainName).not.empty() - }), () => all([deleteKeychain(keychainName)])) -}) + test.ifOsx("create keychain with installers", async() => { + const keychainName = generateKeychainName() + await executeFinally(createKeychain(keychainName, CSC_LINK, process.env.CSC_KEY_PASSWORD) + .then(result => { + assertThat(result.keychainName).isNotEmpty() + }), () => all([deleteKeychain(keychainName)])) + }) +} test.ifOsx("remove password from log", async () => { - assertThat(removePassword("seq -P foo -B")).equal("seq -P 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae (sha256 hash) -B") - assertThat(removePassword("pass:foo")).equal("pass:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae (sha256 hash)") + assertThat(removePassword("seq -P foo -B")).isEqualTo("seq -P 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae (sha256 hash) -B") + assertThat(removePassword("pass:foo")).isEqualTo("pass:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae (sha256 hash)") }) \ No newline at end of file diff --git a/test/src/RepoSlugTest.ts b/test/src/RepoSlugTest.ts index 642aaf38d25..a49e5f887af 100644 --- a/test/src/RepoSlugTest.ts +++ b/test/src/RepoSlugTest.ts @@ -1,5 +1,5 @@ import { Info } from "hosted-git-info" -import * as assertThat from "should/as-function" +import { assertThat } from "./helpers/fileAssert" import test from "ava-tf" import { Promise as BluebirdPromise } from "bluebird" import { getRepositoryInfo } from "out/repositoryInfo" @@ -12,7 +12,7 @@ test("repo slug from TRAVIS_REPO_SLUG", () => { try { process.env.TRAVIS_REPO_SLUG = "travis-ci/travis-build" const info = (>getRepositoryInfo()).value() - assertThat(info).has.properties({ + assertThat(info).hasProperties({ user: "travis-ci", project: "travis-build", }) @@ -43,7 +43,7 @@ test("repo slug from APPVEYOR", () => { process.env.APPVEYOR_ACCOUNT_NAME = "travis-ci" process.env.APPVEYOR_PROJECT_NAME = "travis-build" const info = (>getRepositoryInfo()).value() - assertThat(info).has.properties({ + assertThat(info).hasProperties({ user: "travis-ci", project: "travis-build", }) diff --git a/test/src/helpers/expectedContents.ts b/test/src/helpers/expectedContents.ts index b499f00c203..805def2b891 100755 --- a/test/src/helpers/expectedContents.ts +++ b/test/src/helpers/expectedContents.ts @@ -1,9 +1,10 @@ //noinspection SpellCheckingInspection -export const expectedLinuxContents = [ - "/", +export const expectedLinuxContents = ["/", "/opt/", "/usr/", "/opt/TestApp/", + "/opt/TestApp/blink_image_resources_200_percent.pak", + "/opt/TestApp/content_resources_200_percent.pak", "/opt/TestApp/content_shell.pak", "/opt/TestApp/icudtl.dat", "/opt/TestApp/libffmpeg.so", @@ -13,6 +14,8 @@ export const expectedLinuxContents = [ "/opt/TestApp/natives_blob.bin", "/opt/TestApp/snapshot_blob.bin", "/opt/TestApp/TestApp", + "/opt/TestApp/ui_resources_200_percent.pak", + "/opt/TestApp/views_resources_200_percent.pak", "/usr/share/", "/opt/TestApp/resources/", "/opt/TestApp/resources/app.asar", @@ -50,8 +53,7 @@ export const expectedLinuxContents = [ "/usr/share/icons/hicolor/64x64/apps/", "/usr/share/icons/hicolor/64x64/apps/TestApp.png", "/usr/share/icons/hicolor/96x96/apps/", - "/usr/share/icons/hicolor/96x96/apps/TestApp.png" -] + "/usr/share/icons/hicolor/96x96/apps/TestApp.png"] //noinspection SpellCheckingInspection export const expectedWinContents = [ diff --git a/test/src/helpers/fileAssert.ts b/test/src/helpers/fileAssert.ts index d353b878684..6ec043e8479 100644 --- a/test/src/helpers/fileAssert.ts +++ b/test/src/helpers/fileAssert.ts @@ -29,6 +29,20 @@ class Assertions { compare(this.actual, expected) } + isNotEqualTo(expected: any) { + compare(this.actual, expected, true) + } + + isNotEmpty() { + compare(this.actual, "", true) + } + + doesNotMatch(pattern: RegExp) { + if ((this.actual).match(pattern)) { + throw new Error(`${this.actual} matches ${pattern}`) + } + } + containsAll(expected: Iterable) { compare(this.actual.slice().sort(), Array.from(expected).slice().sort()) } @@ -89,8 +103,8 @@ function prettyDiff(actual: any, expected: any): string { return `\n${diff}\n` } -function compare(actual: any, expected: any) { - if (!json8.equal(actual, expected)) { +function compare(actual: any, expected: any, not: boolean = false) { + if (json8.equal(actual, expected) === not) { const actualJson = JSON.stringify(actual, jsonReplacer, 2) const expectedJson = JSON.stringify(expected, jsonReplacer, 2) const stack = new Error().stack diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 3b89239a8ab..475bb5bddd3 100755 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -1,5 +1,4 @@ import { copy, emptyDir, remove, writeJson, readJson, readFile } from "fs-extra-p" -import * as assertThat2 from "should/as-function" import { assertThat } from "./fileAssert" import * as path from "path" import { parse as parsePlist } from "plist" @@ -172,7 +171,7 @@ async function checkLinuxResult(projectDir: string, packager: Packager, checkOpt assertThat(await getContents(`${projectDir}/${outDirName}/TestApp-${appInfo.version}-i386.deb`)).isEqualTo(expectedContents) } - assertThat2(parseDebControl(await exec("dpkg", ["--info", packageFile]))).has.properties({ + assertThat(parseDebControl(await exec("dpkg", ["--info", packageFile]))).hasProperties({ License: "MIT", Homepage: "http://foo.example.com", Maintainer: "Foo Bar ", @@ -206,7 +205,7 @@ async function checkOsXResult(packager: Packager, packagerOptions: PackagerOptio const appInfo = packager.appInfo const packedAppDir = path.join(path.dirname(artifacts[0].file), `${appInfo.productFilename}.app`) const info = parsePlist(await readFile(path.join(packedAppDir, "Contents", "Info.plist"), "utf8")) - assertThat2(info).has.properties({ + assertThat(info).hasProperties({ CFBundleDisplayName: appInfo.productName, CFBundleIdentifier: "org.electron-builder.testApp", LSApplicationCategoryType: "your.app.category.type", @@ -215,7 +214,7 @@ async function checkOsXResult(packager: Packager, packagerOptions: PackagerOptio if (packagerOptions.cscLink != null) { const result = await exec("codesign", ["--verify", packedAppDir]) - assertThat2(result).not.match(/is not signed at all/) + assertThat(result).doesNotMatch(/is not signed at all/) } const actualFiles = artifacts.map(it => path.basename(it.file)).sort() diff --git a/test/src/macPackagerTest.ts b/test/src/macPackagerTest.ts index 00d8a04e55f..7621d890146 100644 --- a/test/src/macPackagerTest.ts +++ b/test/src/macPackagerTest.ts @@ -5,7 +5,7 @@ import { move, writeFile, deleteFile, remove } from "fs-extra-p" import * as path from "path" import { BuildInfo, PackagerOptions } from "out/platformPackager" import { Promise as BluebirdPromise } from "bluebird" -import * as assertThat from "should/as-function" +import { assertThat } from "./helpers/fileAssert" import { ElectronPackagerOptions } from "out/packager/dirPackager" import { Platform, MacOptions, createTargets } from "out" import { SignOptions, FlatOptions } from "electron-osx-sign" @@ -46,79 +46,84 @@ test.ifOsx("only dmg", createTargetTest(["dmg"], ["Test App ßW-1.1.0.dmg"])) test.ifOsx("only zip", createTargetTest(["zip"], ["Test App ßW-1.1.0-mac.zip"])) test.ifOsx("invalid target", (t: any) => t.throws(createTargetTest(["ttt"], [])(), "Unknown target: ttt")) -test.ifOsx("mas", createTargetTest(["mas"], ["Test App ßW-1.1.0.pkg"])) -test.ifOsx("mas and 7z", createTargetTest(["mas", "7z"], ["Test App ßW-1.1.0-mac.7z", "Test App ßW-1.1.0.pkg"])) - -test.ifOsx("custom mas", () => { - let platformPackager: CheckingMacPackager = null - return assertPack("test-app-one", signed({ - targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), - devMetadata: { - build: { - mac: { - target: ["mas"], - }, - mas: { - entitlements: "mas-entitlements file path", - entitlementsInherit: "mas-entitlementsInherit file path", +if (process.env.CSC_KEY_PASSWORD == null) { + console.warn("Skip mas tests because CSC_KEY_PASSWORD is not defined") +} +else { + test.ifOsx("mas", createTargetTest(["mas"], ["Test App ßW-1.1.0.pkg"])) + test.ifOsx("mas and 7z", createTargetTest(["mas", "7z"], ["Test App ßW-1.1.0-mac.7z", "Test App ßW-1.1.0.pkg"])) + + test.ifOsx("custom mas", () => { + let platformPackager: CheckingMacPackager = null + return assertPack("test-app-one", signed({ + targets: Platform.MAC.createTarget(), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), + devMetadata: { + build: { + mac: { + target: ["mas"], + }, + mas: { + entitlements: "mas-entitlements file path", + entitlementsInherit: "mas-entitlementsInherit file path", + } } } - } - }), { - packed: () => { - assertThat(platformPackager.effectiveSignOptions).has.properties({ - entitlements: "mas-entitlements file path", - "entitlements-inherit": "mas-entitlementsInherit file path", - }) - return BluebirdPromise.resolve(null) - } + }), { + packed: () => { + assertThat(platformPackager.effectiveSignOptions).hasProperties({ + entitlements: "mas-entitlements file path", + "entitlements-inherit": "mas-entitlementsInherit file path", + }) + return BluebirdPromise.resolve(null) + } + }) }) -}) -test.ifOsx("entitlements in the package.json", () => { - let platformPackager: CheckingMacPackager = null - return assertPack("test-app-one", signed({ - targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), - devMetadata: { - build: { - mac: { - entitlements: "osx-entitlements file path", - entitlementsInherit: "osx-entitlementsInherit file path", + test.ifOsx("entitlements in the package.json", () => { + let platformPackager: CheckingMacPackager = null + return assertPack("test-app-one", signed({ + targets: Platform.MAC.createTarget(), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), + devMetadata: { + build: { + mac: { + entitlements: "osx-entitlements file path", + entitlementsInherit: "osx-entitlementsInherit file path", + } } } - } - }), { - packed: () => { - assertThat(platformPackager.effectiveSignOptions).has.properties({ - entitlements: "osx-entitlements file path", - "entitlements-inherit": "osx-entitlementsInherit file path", - }) - return BluebirdPromise.resolve(null) - } + }), { + packed: () => { + assertThat(platformPackager.effectiveSignOptions).hasProperties({ + entitlements: "osx-entitlements file path", + "entitlements-inherit": "osx-entitlementsInherit file path", + }) + return BluebirdPromise.resolve() + } + }) }) -}) -test.ifOsx("entitlements in build dir", () => { - let platformPackager: CheckingMacPackager = null - return assertPack("test-app-one", signed({ - targets: Platform.MAC.createTarget(), - platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), - }), { - tempDirCreated: projectDir => BluebirdPromise.all([ - writeFile(path.join(projectDir, "build", "entitlements.mac.plist"), ""), - writeFile(path.join(projectDir, "build", "entitlements.mac.inherit.plist"), ""), - ]), - packed: projectDir => { - assertThat(platformPackager.effectiveSignOptions).has.properties({ - entitlements: path.join(projectDir, "build", "entitlements.mac.plist"), - "entitlements-inherit": path.join(projectDir, "build", "entitlements.mac.inherit.plist"), - }) - return BluebirdPromise.resolve(null) - } + test.ifOsx("entitlements in build dir", () => { + let platformPackager: CheckingMacPackager = null + return assertPack("test-app-one", signed({ + targets: Platform.MAC.createTarget(), + platformPackagerFactory: (packager, platform, cleanupTasks) => platformPackager = new CheckingMacPackager(packager, cleanupTasks), + }), { + tempDirCreated: projectDir => BluebirdPromise.all([ + writeFile(path.join(projectDir, "build", "entitlements.mac.plist"), ""), + writeFile(path.join(projectDir, "build", "entitlements.mac.inherit.plist"), ""), + ]), + packed: projectDir => { + assertThat(platformPackager.effectiveSignOptions).hasProperties({ + entitlements: path.join(projectDir, "build", "entitlements.mac.plist"), + "entitlements-inherit": path.join(projectDir, "build", "entitlements.mac.inherit.plist"), + }) + return BluebirdPromise.resolve() + } + }) }) -}) +} test.ifOsx("no background", (t: any) => assertPack("test-app-one", platform(Platform.MAC), { tempDirCreated: projectDir => deleteFile(path.join(projectDir, "build", "background.png")) @@ -145,8 +150,8 @@ test.ifOsx("custom background - old way", () => { }) ]), packed: () => { - assertThat(platformPackager.effectiveDistOptions.background).equal(customBackground) - assertThat(platformPackager.effectiveDistOptions.icon).equal("foo.icns") + assertThat(platformPackager.effectiveDistOptions.background).isEqualTo(customBackground) + assertThat(platformPackager.effectiveDistOptions.icon).isEqualTo("foo.icns") return BluebirdPromise.resolve(null) }, }) @@ -178,9 +183,9 @@ test.ifOsx("custom background - new way", () => { }) ]), packed: projectDir => { - assertThat(platformPackager.effectiveDistOptions.background).equal(customBackground) - assertThat(platformPackager.effectiveDistOptions.icon).equal("foo.icns") - assertThat(platformPackager.effectivePackOptions.icon).equal(path.join(projectDir, "customIcon.icns")) + assertThat(platformPackager.effectiveDistOptions.background).isEqualTo(customBackground) + assertThat(platformPackager.effectiveDistOptions.icon).isEqualTo("foo.icns") + assertThat(platformPackager.effectivePackOptions.icon).isEqualTo(path.join(projectDir, "customIcon.icns")) return BluebirdPromise.resolve(null) }, }) @@ -203,9 +208,9 @@ test.ifOsx("disable dmg icon, bundleVersion", () => { } }, { packed: () => { - assertThat(platformPackager.effectiveDistOptions.icon).equal(null) - assertThat(platformPackager.effectivePackOptions.icon).not.equal(null) - assertThat(platformPackager.appInfo.buildVersion).equal("50") + assertThat(platformPackager.effectiveDistOptions.icon).isEqualTo(null) + assertThat(platformPackager.effectivePackOptions.icon).isNotEqualTo(null) + assertThat(platformPackager.appInfo.buildVersion).isEqualTo("50") return BluebirdPromise.resolve(null) }, }) diff --git a/test/typings/should.d.ts b/test/typings/should.d.ts deleted file mode 100644 index 0d556ff44f6..00000000000 --- a/test/typings/should.d.ts +++ /dev/null @@ -1,176 +0,0 @@ -// Compiled using typings@0.6.9 -// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/5aa6dff6990465c7fb41504538ad7aa133ab01d3/should/should.d.ts -// Type definitions for should.js v8.1.1 -// Project: https://github.com/shouldjs/should.js -// Definitions by: Alex Varju , Maxime LUCE -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -interface Object { - should: ShouldAssertion; -} - -interface ShouldAssertion { - // basic grammar - a: ShouldAssertion; - an: ShouldAssertion; - and: ShouldAssertion; - be: ShouldAssertion; - has: ShouldAssertion; - have: ShouldAssertion; - is: ShouldAssertion; - it: ShouldAssertion; - with: ShouldAssertion; - which: ShouldAssertion; - the: ShouldAssertion; - of: ShouldAssertion; - not: ShouldAssertion; - - // validators - arguments(): ShouldAssertion; - empty(): ShouldAssertion; - ok(): ShouldAssertion; - true(): ShouldAssertion; - false(): ShouldAssertion; - NaN(): ShouldAssertion; - Infinity(): ShouldAssertion; - Array(): ShouldAssertion; - Object(): ShouldAssertion; - String(): ShouldAssertion; - Boolean(): ShouldAssertion; - Number(): ShouldAssertion; - Error(): ShouldAssertion; - Function(): ShouldAssertion; - Date(): ShouldAssertion; - Class(): ShouldAssertion; - generator(): ShouldAssertion; - iterable(): ShouldAssertion; - iterator(): ShouldAssertion; - eql(expected: any, description?: string): ShouldAssertion; - equal(expected: any, description?: string): ShouldAssertion; - equalOneOf(...values: any[]): ShouldAssertion; - within(start: number, finish: number, description?: string): ShouldAssertion; - approximately(value: number, delta: number, description?: string): ShouldAssertion; - type(expected: any, description?: string): ShouldAssertion; - instanceof(constructor: Function, description?: string): ShouldAssertion; - above(n: number, description?: string): ShouldAssertion; - below(n: number, description?: string): ShouldAssertion; - aboveOrEqual(n: number, description?: string): ShouldAssertion; - greaterThanOrEqual(n: number, description?: string): ShouldAssertion; - belowOrEqual(n: number, description?: string): ShouldAssertion; - lessThanOrEqual(n: number, description?: string): ShouldAssertion; - match(other: {}, description?: string): ShouldAssertion; - match(other: (val: any) => any, description?: string): ShouldAssertion; - match(regexp: RegExp, description?: string): ShouldAssertion; - match(other: any, description?: string): ShouldAssertion; - matchEach(other: {}, description?: string): ShouldAssertion; - matchEach(other: (val: any) => any, description?: string): ShouldAssertion; - matchEach(regexp: RegExp, description?: string): ShouldAssertion; - matchEach(other: any, description?: string): ShouldAssertion; - matchAny(other: {}, description?: string): ShouldAssertion; - matchAny(other: (val: any) => any, description?: string): ShouldAssertion; - matchAny(regexp: RegExp, description?: string): ShouldAssertion; - matchAny(other: any, description?: string): ShouldAssertion; - length(n: number, description?: string): ShouldAssertion; - property(name: string, description?: string): ShouldAssertion; - property(name: string, val: any, description?: string): ShouldAssertion; - properties(names: string[]): ShouldAssertion; - properties(name: string): ShouldAssertion; - properties(descriptor: any): ShouldAssertion; - properties(...properties: string[]): ShouldAssertion; - propertyByPath(...properties: string[]): ShouldAssertion; - propertyWithDescriptor(name: string, descriptor: PropertyDescriptor): ShouldAssertion; - oneOf(...values: any[]): ShouldAssertion; - ownProperty(name: string, description?: string): ShouldAssertion; - containEql(obj: any): ShouldAssertion; - containDeep(obj: any): ShouldAssertion; - containDeepOrdered(obj: any): ShouldAssertion; - keys(...allKeys: string[]): ShouldAssertion; - keys(allKeys: string[]): ShouldAssertion; - enumerable(property: string, value?: any): ShouldAssertion; - enumerables(...properties: string[]): ShouldAssertion; - startWith(expected: string, message?: any): ShouldAssertion; - endWith(expected: string, message?: any): ShouldAssertion; - throw(message?: any): ShouldAssertion; - - //http - header(field: string, val?: string): ShouldAssertion; - status(code: number): ShouldAssertion; - json(): ShouldAssertion; - html(): ShouldAssertion; - - //stubs - alwaysCalledOn(thisTarget: any): ShouldAssertion; - alwaysCalledWith(...arguments: any[]): ShouldAssertion; - alwaysCalledWithExactly(...arguments: any[]): ShouldAssertion; - alwaysCalledWithMatch(...arguments: any[]): ShouldAssertion; - alwaysCalledWithNew(): ShouldAssertion; - alwaysThrew(exception?: any): ShouldAssertion; - callCount(count: number): ShouldAssertion; - called(): ShouldAssertion; - calledOn(thisTarget: any): ShouldAssertion; - calledOnce(): ShouldAssertion; - calledTwice(): ShouldAssertion; - calledThrice(): ShouldAssertion; - calledWith(...arguments: any[]): ShouldAssertion; - calledWithExactly(...arguments: any[]): ShouldAssertion; - calledWithMatch(...arguments: any[]): ShouldAssertion; - calledWithNew(): ShouldAssertion; - neverCalledWith(...arguments: any[]): ShouldAssertion; - neverCalledWithMatch(...arguments: any[]): ShouldAssertion; - threw(exception?: any): ShouldAssertion; - - // aliases - True(): ShouldAssertion; - False(): ShouldAssertion; - Arguments(): ShouldAssertion; - class(): ShouldAssertion; - deepEqual(expected: any, description?: string): ShouldAssertion; - exactly(expected: any, description?: string): ShouldAssertion; - instanceOf(constructor: Function, description?: string): ShouldAssertion; - throwError(message?: any): ShouldAssertion; - lengthOf(n: number, description?: string): ShouldAssertion; - key(key: string): ShouldAssertion; - hasOwnProperty(name: string, description?: string): ShouldAssertion; - greaterThan(n: number, description?: string): ShouldAssertion; - lessThan(n: number, description?: string): ShouldAssertion; -} - -interface ShouldInternal { - // should.js's extras - exist(actual: any, msg?: string): void; - exists(actual: any, msg?: string): void; - not: ShouldInternal; -} - -interface Internal extends ShouldInternal { - (obj: any): ShouldAssertion; - - // node.js's assert functions - fail(actual: any, expected: any, message: string, operator: string): void; - assert(value: any, message: string): void; - ok(value: any, message?: string): void; - equal(actual: any, expected: any, message?: string): void; - notEqual(actual: any, expected: any, message?: string): void; - deepEqual(actual: any, expected: any, message?: string): void; - notDeepEqual(actual: any, expected: any, message?: string): void; - strictEqual(actual: any, expected: any, message?: string): void; - notStrictEqual(actual: any, expected: any, message?: string): void; - throws(block: any, error?: any, message?: string): void; - doesNotThrow(block: any, message?: string): void; - ifError(value: any): void; - inspect(value: any, obj: any): any; -} - -declare var should: Internal; -declare var Should: Internal; -interface Window { - Should: Internal; -} - -declare module "should" { - export = should; -} - -declare module "should/as-function" { - export = should; -} \ No newline at end of file