Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('cores have separate plugins', async () => {
// Setup
const { _fs } = await makeFixture('test-cores')
plugins.set('fs', _fs)
cores.create('third').set('foo', _fs)
expect(cores.get('default').has('fs')).toBeTruthy()
expect(cores.get('default').has('foo')).toBeFalsy()
expect(cores.get('third').has('fs')).toBeFalsy()
expect(cores.get('third').get('foo')).toBeTruthy()
})
it('plugin schema violation', async () => {
it('cores.get', async () => {
// Setup
const { _fs } = await makeFixture('test-cores')
cores.get('default').set('fs', _fs)
let error = null
try {
cores.get('first').set('fs', _fs)
} catch (err) {
error = err
}
expect(error).not.toBeNull()
expect(error.code).toEqual(E.CoreNotFound)
})
it('core.create', async () => {
it('cores.get', async () => {
// Setup
const { _fs } = await makeFixture('test-cores')
cores.get('default').set('fs', _fs)
let error = null
try {
cores.get('first').set('fs', _fs)
} catch (err) {
error = err
}
expect(error).not.toBeNull()
expect(error.code).toEqual(E.CoreNotFound)
})
it('core.create', async () => {
it('cores have separate plugins', async () => {
// Setup
const { _fs } = await makeFixture('test-cores')
plugins.set('fs', _fs)
cores.create('third').set('foo', _fs)
expect(cores.get('default').has('fs')).toBeTruthy()
expect(cores.get('default').has('foo')).toBeFalsy()
expect(cores.get('third').has('fs')).toBeFalsy()
expect(cores.get('third').get('foo')).toBeTruthy()
})
it('plugin schema violation', async () => {
it('core.create', async () => {
// Setup
const { _fs } = await makeFixture('test-cores')
cores.get('default').set('fs', _fs)
let error = null
try {
cores.create('second').set('fs', _fs)
} catch (err) {
error = err
}
expect(error).toBeNull()
expect(cores.get('second').get('fs')).toBe(_fs)
})
it('cores have separate plugins', async () => {
it('cores have separate plugins', async () => {
// Setup
const { _fs } = await makeFixture('test-cores')
plugins.set('fs', _fs)
cores.create('third').set('foo', _fs)
expect(cores.get('default').has('fs')).toBeTruthy()
expect(cores.get('default').has('foo')).toBeFalsy()
expect(cores.get('third').has('fs')).toBeFalsy()
expect(cores.get('third').get('foo')).toBeTruthy()
})
it('plugin schema violation', async () => {
it('plugins === cores.get(default)', async () => {
expect(plugins).toBe(cores.get('default'))
})
it('cores.get', async () => {