feat: 新增包文件
This commit is contained in:
24
packages/electron-chrome-extensions/spec/extensions-spec.ts
Normal file
24
packages/electron-chrome-extensions/spec/extensions-spec.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user