(script)
| 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: |
no test coverage detected
searching dependent graphs…