-
-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rename some constructor params for MakerBase and PublisherB…
…ase (#2994)
- Loading branch information
1 parent
493368c
commit b97c906
Showing
5 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
Binary file removed
BIN
-394 Bytes
...st/fixture/app-with-scoped-name/out/make/zip/linux/x64/@scope-package-linux-x64-1.0.0.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { expect } from 'chai'; | ||
import { stub } from 'sinon'; | ||
|
||
import MakerBase from '../src/Maker'; | ||
|
||
class MakerImpl extends MakerBase<{ a: number }> { | ||
name = 'test'; | ||
|
||
defaultPlatforms = []; | ||
} | ||
|
||
describe('prepareConfig', () => { | ||
it('should call the provided configure function', () => { | ||
const fetcher = stub(); | ||
fetcher.returns({ | ||
a: 123, | ||
}); | ||
const maker = new MakerImpl(fetcher, []); | ||
expect(maker.config).to.be.undefined; | ||
expect(fetcher.callCount).to.equal(0); | ||
maker.prepareConfig('x64'); | ||
expect(maker.config).to.deep.equal({ | ||
a: 123, | ||
}); | ||
expect(fetcher.callCount).to.equal(1); | ||
expect(fetcher.firstCall.args).to.deep.equal(['x64']); | ||
}); | ||
|
||
it('should hand through the provided object', () => { | ||
const maker = new MakerImpl( | ||
{ | ||
a: 234, | ||
}, | ||
[] | ||
); | ||
expect(maker.config).to.be.undefined; | ||
maker.prepareConfig('x64'); | ||
expect(maker.config).to.deep.equal({ | ||
a: 234, | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters