|
1 | 1 | import path from "node:path"; |
2 | 2 | import createEsmUtils from "esm-utils"; |
3 | | -import { BOM, FULL_TEST } from "./constants.js"; |
| 3 | +import { FULL_TEST } from "./constants.js"; |
4 | 4 | import * as failedTests from "./failed-format-tests.js"; |
5 | 5 | import { format } from "./run-prettier.js"; |
6 | 6 | import consistentEndOfLine from "./utils/consistent-end-of-line.js"; |
7 | 7 | import createSnapshot from "./utils/create-snapshot.js"; |
8 | 8 | import visualizeEndOfLine from "./utils/visualize-end-of-line.js"; |
9 | 9 | import * as testAstCompare from "./test-ast-compare.js"; |
| 10 | +import * as testBom from "./test-bom.js"; |
10 | 11 | import * as testEndOfLine from "./test-end-of-line.js"; |
11 | 12 | import * as testSecondFormat from "./test-second-format.js"; |
12 | 13 | import { shouldThrowOnFormat } from "./utilities.js"; |
@@ -132,15 +133,7 @@ async function runTest({ |
132 | 133 | await testAstCompare.run(code, formatResult, filename, formatOptions); |
133 | 134 | await testEndOfLine.run(code, formatResult, filename, formatOptions, "\r\n"); |
134 | 135 | await testEndOfLine.run(code, formatResult, filename, formatOptions, "\r"); |
135 | | - |
136 | | - if (code.charAt(0) !== BOM) { |
137 | | - const { eolVisualizedOutput: output } = await format( |
138 | | - BOM + code, |
139 | | - formatOptions, |
140 | | - ); |
141 | | - const expected = BOM + formatResult.eolVisualizedOutput; |
142 | | - expect(output).toEqual(expected); |
143 | | - } |
| 136 | + await testBom.run(code, formatResult, filename, formatOptions); |
144 | 137 |
|
145 | 138 | if (shouldCompareBytecode(filename, formatOptions)) { |
146 | 139 | const output = compileContract(filename, formatResult.output); |
|
0 commit comments