Skip to content
Permalink
Browse files

test(publisher-base): add __is test for base publisher

  • Loading branch information
MarshallOfSound committed Nov 24, 2018
1 parent ec34411 commit 503f30255e3f8ccfb1b3412449e6720f652246b2
Showing with 13 additions and 0 deletions.
  1. +13 −0 packages/publisher/base/test/Publisher_spec.ts
@@ -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());

0 comments on commit 503f302

Please sign in to comment.
You can’t perform that action at this time.