initial
This commit is contained in:
1
test/hi2.js
Normal file
1
test/hi2.js
Normal file
@ -0,0 +1 @@
|
||||
console.log('this is required from disk')
|
1
test/test.d.ts
vendored
Normal file
1
test/test.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
import 'typings-test';
|
21
test/test.js
Normal file
21
test/test.js
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-test");
|
||||
const path = require("path");
|
||||
const smartinject = require("../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'));
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx3QkFBcUI7QUFHckIsNkJBQTRCO0FBRTVCLDZDQUE0QztBQUU1QyxRQUFRLENBQUMsYUFBYSxFQUFFO0lBQ3BCLEVBQUUsQ0FBQyxzQ0FBc0MsRUFBRTtRQUN2QyxNQUFNLENBQUMsV0FBVyxDQUFDLGVBQWUsQ0FBQztZQUMvQjtnQkFDSSxJQUFJLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsT0FBTyxDQUFDO2dCQUNuQyxRQUFRLEVBQUUsSUFBSSxNQUFNLENBQ3BDOztDQUVDLENBQUM7YUFDVztTQUNKLENBQUMsQ0FBQTtJQUNOLENBQUMsQ0FBQyxDQUFBO0lBRUYsRUFBRSxDQUFDLDBCQUEwQixFQUFFO1FBQzNCLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFBO0lBQzFDLENBQUMsQ0FBQyxDQUFBO0FBQ04sQ0FBQyxDQUFDLENBQUEifQ==
|
24
test/test.ts
Normal file
24
test/test.ts
Normal file
@ -0,0 +1,24 @@
|
||||
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'))
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user