Files
zn-ai/packages/electron-chrome-extensions/spec/extensions-spec.ts
2025-11-15 22:41:50 +08:00

25 lines
731 B
TypeScript

import { expect } from 'chai'
import { session } from 'electron'
import { ElectronChromeExtensions } from '../'
describe('Extensions', () => {
const testSession = session.fromPartition('test-extensions')
const extensions = new ElectronChromeExtensions({
license: 'internal-license-do-not-use' as any,
session: testSession,
})
it('retrieves the instance with fromSession()', () => {
expect(ElectronChromeExtensions.fromSession(testSession)).to.equal(extensions)
})
it('throws when two instances are created for session', () => {
expect(() => {
new ElectronChromeExtensions({
license: 'internal-license-do-not-use' as any,
session: testSession,
})
}).to.throw()
})
})