Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

build: enable windows in travis #42

Merged
merged 9 commits into from
Apr 6, 2019
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: false
os:
# - windows
- windows
- linux
- osx
language: node_js
Expand All @@ -9,7 +9,7 @@ node_js:
- "11.10"
install:
- npm install
- npm install --prefix integration/app-with-serverless-offline
- cd integration/app-with-serverless-offline && npm install && cd ../../
script:
- npm run lint
- npm test
Expand Down
7 changes: 6 additions & 1 deletion integration/__tests__/local-deploy.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const execSync = require("child_process").execSync;
const path = require("path");
const serverlessOfflineStart = require("../../utils/test/serverlessOfflineStart");
const httpGet = require("../../utils/test/httpGet");
Expand All @@ -13,7 +14,11 @@ describe("Local Deployment Tests (via serverless-offline)", () => {
});

afterAll(() => {
slsOffline.kill();
if (process.platform === "win32") {
execSync(`taskkill /pid ${slsOffline.pid} /f /t`);
} else {
slsOffline.kill();
}
});

it("should render the index page", () => {
Expand Down
4 changes: 2 additions & 2 deletions utils/test/serverlessOfflineStart.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const serverlessExec = require("./getServerlessExec");
const bufferToStr = buffer => Buffer.from(buffer).toString("utf8");

module.exports = () => {
return new Promise((resolve, reject) => {
const serverlessOffline = spawn(serverlessExec, ["offline"]);
const serverlessOffline = spawn(serverlessExec, ["offline"]);

return new Promise((resolve, reject) => {
serverlessOffline.stdout.on("data", data => {
const stdoutStr = bufferToStr(data);

Expand Down