Skip to content

Commit 503f302

Browse files
test(publisher-base): add __is test for base publisher
1 parent ec34411 commit 503f302

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/publisher/base/test/Publisher_spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ describe('Publisher', () => {
1313
expect(publisher).to.have.property('__isElectronForgePublisher', true);
1414
});
1515

16+
it('__isElectronForgePublisher should not be settable', () => {
17+
const publisher = new PublisherImpl(null);
18+
expect(() => {
19+
(publisher as any).__isElectronForgePublisher = false;
20+
}).to.throw();
21+
expect(() => {
22+
Object.defineProperty(publisher, '__isElectronForgePublisher', {
23+
value: false,
24+
});
25+
}).to.throw();
26+
expect(publisher).to.have.property('__isElectronForgePublisher', true);
27+
});
28+
1629
it('should throw an error when publish is called is called', (done) => {
1730
const publisher = new PublisherImpl(null);
1831
publisher.publish({} as any).catch(() => done());

0 commit comments

Comments
 (0)