MCPcopy
hub / github.com/lebab/lebab / expectTransform

Function expectTransform

test/createTestHelpers.js:18–34  ·  view source on GitHub ↗
(script)

Source from the content-addressed store, hash-verified

16 // .withWarnings(["My warning"]);
17 //
18 function expectTransform(script) {
19 const {code, warnings} = transformer.run(script);
20
21 return {
22 toReturn(expectedValue) {
23 expect(code).to.equal(expectedValue);
24 return this;
25 },
26 withWarnings(expectedWarnings) {
27 expect(warnings).to.deep.equal(expectedWarnings);
28 return this;
29 },
30 withoutWarnings() {
31 return this.withWarnings([]);
32 },
33 };
34 }
35
36 // Asserts that transforming the string has no effect,
37 // and also allows to check for warnings like so:

Callers 15

expectNoChangeFunction · 0.85
argRestTest.jsFile · 0.85
forOfTest.jsFile · 0.85
arrowTest.jsFile · 0.85
letTest.jsFile · 0.85
restSpreadTest.jsFile · 0.85
noStrictTest.jsFile · 0.85
whitespaceTest.jsFile · 0.85
forEachTest.jsFile · 0.85
argSpreadTest.jsFile · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…