Skip to content

Commit

Permalink
test: enable building the native module test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jun 26, 2022
1 parent 841c5c5 commit 8afab95
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions spec/install-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ describe("apm install", function () {
})
})

describe("when installing a registred package and --json is specified", function () {
describe("when installing a registered package and --json is specified", function () {
beforeEach(function () {
const callback = jasmine.createSpy("callback")

Expand All @@ -629,30 +629,8 @@ describe("apm install", function () {
})
})

describe("with a space in node-gyp's path", function () {
const nodeModules = fs.realpathSync(path.join(__dirname, "..", "node_modules"))

beforeEach(function () {
// Normally npm_config_node_gyp would be ignored, but it works here because we're calling apm
// directly and not through the scripts in bin/
const nodeGypPath = path.dirname(path.dirname(resolveSync("node-gyp"))) // find an installed node-gyp
fs.copySync(nodeGypPath, path.join(nodeModules, "with a space"))
process.env.npm_config_node_gyp = path.join(nodeModules, "with a space", "bin", "node-gyp.js")

// Read + execute permission
return fs.chmodSync(process.env.npm_config_node_gyp, fs.constants.S_IRUSR | fs.constants.S_IXUSR)
})

afterEach(function () {
delete process.env.npm_config_node_gyp
return fs.removeSync(path.join(nodeModules, "with a space"))
})

describe("with the bundled node-gyp", function () {
it("builds native code successfully", function () {
if (process.platform === "win32") {
console.warn("Test skipped on windows") // TODO
return
}
const callback = jasmine.createSpy("callback")
apm.run(["install", "native-package"], callback)

Expand Down

0 comments on commit 8afab95

Please sign in to comment.