diff --git a/lib/plugins/package/tests/zipService.js b/lib/plugins/package/tests/zipService.js index 6c8032a22..723bab8f2 100644 --- a/lib/plugins/package/tests/zipService.js +++ b/lib/plugins/package/tests/zipService.js @@ -2,6 +2,7 @@ const expect = require('chai').expect; const fs = require('fs'); +const os = require('os'); const path = require('path'); const JsZip = require('jszip'); const _ = require('lodash'); @@ -140,13 +141,19 @@ describe('#zipService()', () => { }).then(unzippedData => { const unzippedFileData = unzippedData.files; - // binary file is set with chmod of 777 - expect(unzippedFileData['bin/some-binary'].unixPermissions) - .to.equal(Math.pow(2, 15) + 777); + if (os.platform() === 'win32') { + // chmod does not work right on windows. this is better than nothing? + expect(unzippedFileData['bin/some-binary'].unixPermissions) + .to.not.equal(unzippedFileData['bin/read-only'].unixPermissions); + } else { + // binary file is set with chmod of 777 + expect(unzippedFileData['bin/some-binary'].unixPermissions) + .to.equal(Math.pow(2, 15) + 777); - // read only file is set with chmod of 444 - expect(unzippedFileData['bin/read-only'].unixPermissions) - .to.equal(Math.pow(2, 15) + 444); + // read only file is set with chmod of 444 + expect(unzippedFileData['bin/read-only'].unixPermissions) + .to.equal(Math.pow(2, 15) + 444); + } }); }); diff --git a/tests/classes/Utils.js b/tests/classes/Utils.js index 45cf13926..afa2b766b 100644 --- a/tests/classes/Utils.js +++ b/tests/classes/Utils.js @@ -135,7 +135,7 @@ describe('Utils', () => { expect(() => { serverless.utils.readFileSync(tmpFilePath); - }).to.throw(new RegExp(`in "${tmpFilePath}"`)); + }).to.throw(new RegExp('YAMLException:.*invalid.yml')); }); });