|
3 | 3 | const BbPromise = require('bluebird');
|
4 | 4 | const _ = require('lodash');
|
5 | 5 | const chai = require('chai');
|
| 6 | +const path = require('path'); |
6 | 7 | const sinon = require('sinon');
|
7 | 8 | const mockery = require('mockery');
|
8 | 9 | const Serverless = require('serverless');
|
@@ -134,10 +135,12 @@ describe('packageModules', () => {
|
134 | 135 | fsMock._streamMock.on.withArgs('close').yields();
|
135 | 136 | fsMock._statMock.isDirectory.returns(false);
|
136 | 137 |
|
| 138 | + const expectedArtifactPath = path.join('.serverless', 'test-service.zip'); |
| 139 | + |
137 | 140 | return expect(module.packageModules(stats)).to.be.fulfilled
|
138 | 141 | .then(() => BbPromise.all([
|
139 |
| - expect(func1).to.have.a.nested.property('package.artifact').that.equals('.serverless/test-service.zip'), |
140 |
| - expect(func2).to.have.a.nested.property('package.artifact').that.equals('.serverless/test-service.zip'), |
| 142 | + expect(func1).to.have.a.nested.property('package.artifact').that.equals(expectedArtifactPath), |
| 143 | + expect(func2).to.have.a.nested.property('package.artifact').that.equals(expectedArtifactPath), |
141 | 144 | ]));
|
142 | 145 | });
|
143 | 146 |
|
@@ -205,8 +208,8 @@ describe('packageModules', () => {
|
205 | 208 |
|
206 | 209 | return expect(module.packageModules(stats)).to.be.fulfilled
|
207 | 210 | .then(() => BbPromise.all([
|
208 |
| - expect(func1).to.have.a.nested.property('package.artifact').that.equals('.serverless/func1.zip'), |
209 |
| - expect(func2).to.have.a.nested.property('package.artifact').that.equals('.serverless/func2.zip'), |
| 211 | + expect(func1).to.have.a.nested.property('package.artifact').that.equals(path.join('.serverless', 'func1.zip')), |
| 212 | + expect(func2).to.have.a.nested.property('package.artifact').that.equals(path.join('.serverless', 'func2.zip')), |
210 | 213 | ]));
|
211 | 214 | });
|
212 | 215 |
|
@@ -252,20 +255,22 @@ describe('packageModules', () => {
|
252 | 255 | fsMock._streamMock.on.withArgs('close').yields();
|
253 | 256 | fsMock._statMock.isDirectory.returns(false);
|
254 | 257 |
|
| 258 | + const expectedArtifactPath = path.join('.serverless', 'test-service.zip'); |
| 259 | + |
255 | 260 | return BbPromise.each([ '1.18.1', '2.17.0', '10.15.3', ], version => {
|
256 | 261 | getVersionStub.returns(version);
|
257 | 262 | return expect(module.packageModules(stats)).to.be.fulfilled
|
258 | 263 | .then(() => BbPromise.all([
|
259 |
| - expect(func1).to.have.a.nested.property('package.artifact').that.equals('.serverless/test-service.zip'), |
260 |
| - expect(func2).to.have.a.nested.property('package.artifact').that.equals('.serverless/test-service.zip'), |
| 264 | + expect(func1).to.have.a.nested.property('package.artifact').that.equals(expectedArtifactPath), |
| 265 | + expect(func2).to.have.a.nested.property('package.artifact').that.equals(expectedArtifactPath), |
261 | 266 | ]));
|
262 | 267 | })
|
263 | 268 | .then(() => BbPromise.each([ '1.17.0', '1.16.0-alpha', '1.15.3', ], version => {
|
264 | 269 | getVersionStub.returns(version);
|
265 | 270 | return expect(module.packageModules(stats)).to.be.fulfilled
|
266 | 271 | .then(() => BbPromise.all([
|
267 |
| - expect(func1).to.have.a.nested.property('artifact').that.equals('.serverless/test-service.zip'), |
268 |
| - expect(func2).to.have.a.nested.property('artifact').that.equals('.serverless/test-service.zip'), |
| 272 | + expect(func1).to.have.a.nested.property('artifact').that.equals(expectedArtifactPath), |
| 273 | + expect(func2).to.have.a.nested.property('artifact').that.equals(expectedArtifactPath), |
269 | 274 | ]));
|
270 | 275 | }));
|
271 | 276 | });
|
|
0 commit comments