mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
fix Tests not passing on Windows
This commit is contained in:
parent
d17801d39c
commit
4490af73c0
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ describe('Utils', () => {
|
||||
|
||||
expect(() => {
|
||||
serverless.utils.readFileSync(tmpFilePath);
|
||||
}).to.throw(new RegExp(`in "${tmpFilePath}"`));
|
||||
}).to.throw(new RegExp('YAMLException:.*invalid.yml'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user