smartinject/test/test.ts

24 lines
607 B
TypeScript
Raw Normal View History

2017-02-28 22:40:13 +00:00
import 'typings-test'
import { expect } from 'smartchai'
import * as path from 'path'
import * as smartinject from '../dist/index'
describe('smartinject', function() {
it('should inject a file using fileArray', function() {
return smartinject.injectFileArray([
{
path: path.join(__dirname, 'hi.js'),
contents: new Buffer(
`require('./hi2.js')
console.log('this console comment was injected')
`)
}
])
})
it('should log hi to console', function() {
require(path.join(__dirname, 'hi.js'))
})
})