-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutils.spec.js
32 lines (28 loc) · 876 Bytes
/
utils.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
let expect = require("chai").expect;
let utils = require("./utils");
describe("Utils", function() {
describe("Remove instrumentation", function() {
it.skip("Given an example function, it should return the expected value", function() {
let input = utils.exampleFunction.toString();
let sanitised = utils.removeInstrumentation(input);
let expected = `function exampleFunction(input) {
console.log("Some line of code");
if (true === false) {
return;
}
return input
.replace(new RegExp("", "g"), "")
.replace(new RegExp("", "g"), "");
}`;
// For debugging
// console.log('INPUT');
// console.log(input);
// console.log('SANITISED');
// console.log(sanitised);
// console.log('EXPECTED');
// console.log(expected);
expect(sanitised).to.equal(expected);
});
});
});