2017-05-13 09:03:24 +00:00
|
|
|
import { tap, expect } from 'tapbundle'
|
2017-07-31 13:16:10 +00:00
|
|
|
import * as smartsystem from '../ts/index'
|
2017-05-13 09:03:24 +00:00
|
|
|
import * as _moduleExample from './assets/moduleExample'
|
2016-10-12 12:01:15 +00:00
|
|
|
|
2017-07-31 13:16:10 +00:00
|
|
|
let lazyModuleExample: smartsystem.LazyModule<typeof _moduleExample>
|
2016-10-12 12:01:15 +00:00
|
|
|
|
2017-07-31 13:16:10 +00:00
|
|
|
tap.test('should create a lazy module instance', async (tools) => {
|
|
|
|
lazyModuleExample = new smartsystem.LazyModule<typeof _moduleExample>('./assets/moduleExample.js', __dirname)
|
|
|
|
expect(lazyModuleExample).to.be.instanceof(smartsystem.LazyModule)
|
|
|
|
})
|
|
|
|
|
|
|
|
tap.test('should load the module', async () => {
|
2017-05-13 09:03:24 +00:00
|
|
|
await lazyModuleExample.load().then(async m => {
|
|
|
|
console.log(m.exportedTestBoolean)
|
|
|
|
})
|
2016-10-12 12:01:15 +00:00
|
|
|
})
|
2017-05-13 09:03:24 +00:00
|
|
|
|
|
|
|
tap.start()
|