2017-07-28 16:19:06 +00:00
|
|
|
import { tap, expect } from 'tapbundle'
|
2017-02-28 22:40:13 +00:00
|
|
|
|
|
|
|
import * as path from 'path'
|
|
|
|
|
|
|
|
import * as smartinject from '../dist/index'
|
|
|
|
|
2017-07-28 16:19:06 +00:00
|
|
|
tap.test('should inject a file using fileArray', async () => {
|
|
|
|
return smartinject.injectFileArray([
|
|
|
|
{
|
|
|
|
path: path.join(__dirname, 'hi.js'),
|
|
|
|
contents: new Buffer(
|
|
|
|
`require('./hi2.js')
|
2017-02-28 22:40:13 +00:00
|
|
|
console.log('this console comment was injected')
|
2017-07-28 16:19:06 +00:00
|
|
|
`)
|
|
|
|
}
|
|
|
|
])
|
|
|
|
})
|
2017-02-28 22:40:13 +00:00
|
|
|
|
2017-07-28 16:19:06 +00:00
|
|
|
tap.test('should log hi to console', async () => {
|
|
|
|
require(path.join(__dirname, 'hi.js'))
|
|
|
|
})
|
|
|
|
|
|
|
|
tap.start()
|