Skip to content

Commit

Permalink
test(publisher-base): add __is test for base publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Nov 24, 2018
1 parent ec34411 commit 503f302
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/publisher/base/test/Publisher_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ describe('Publisher', () => {
expect(publisher).to.have.property('__isElectronForgePublisher', true);
});

it('__isElectronForgePublisher should not be settable', () => {
const publisher = new PublisherImpl(null);
expect(() => {
(publisher as any).__isElectronForgePublisher = false;
}).to.throw();
expect(() => {
Object.defineProperty(publisher, '__isElectronForgePublisher', {
value: false,
});
}).to.throw();
expect(publisher).to.have.property('__isElectronForgePublisher', true);
});

it('should throw an error when publish is called is called', (done) => {
const publisher = new PublisherImpl(null);
publisher.publish({} as any).catch(() => done());
Expand Down

0 comments on commit 503f302

Please sign in to comment.