diff --git a/.eslintrc b/.eslintrc index eb3058129..d2b9b756b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,7 @@ }, "extends": ["airbnb-base", "prettier"], "globals": { - "run_spec": false + "runFormatTest": "readonly" }, "parserOptions": { "ecmaVersion": "latest", diff --git a/jest.config.js b/jest.config.js index 79f72f497..2feb5fb4a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,6 @@ const TEST_STANDALONE = Boolean(process.env.TEST_STANDALONE); const testMatch = [ - '/tests/format/**/jsfmt.spec.js', + '/tests/format/**/format.test.js', '/tests/unit/**/*.test.js' ]; @@ -11,7 +11,7 @@ if (TEST_STANDALONE) { export default { runner: 'jest-light-runner', - setupFiles: ['/tests/config/setup.js'], + setupFiles: ['/tests/config/format-test-setup.js'], snapshotSerializers: [ 'jest-snapshot-serializer-raw', 'jest-snapshot-serializer-ansi' diff --git a/tests/config/.prettierrc b/tests/config/.prettierrc index befe74aca..f3bcd4c90 100644 --- a/tests/config/.prettierrc +++ b/tests/config/.prettierrc @@ -1,5 +1,4 @@ { - "singleQuote": false, - "trailingComma": "es5" - } - \ No newline at end of file + "singleQuote": false, + "trailingComma": "all" +} diff --git a/tests/config/format-test-setup.js b/tests/config/format-test-setup.js new file mode 100644 index 000000000..98222ffc2 --- /dev/null +++ b/tests/config/format-test-setup.js @@ -0,0 +1,3 @@ +import runFormatTest from "./run-format-test.js"; + +globalThis.runFormatTest = runFormatTest; diff --git a/tests/config/get-prettier.js b/tests/config/get-prettier.js index 5d72040c0..6a7446292 100644 --- a/tests/config/get-prettier.js +++ b/tests/config/get-prettier.js @@ -1,7 +1,7 @@ function getPrettierInternal() { const entry = process.env.TEST_STANDALONE ? new URL("./require-standalone.cjs", import.meta.url) - : new URL("./require-prettier.cjs", import.meta.url); + : "prettier"; return import(entry).then((module) => module.default); } diff --git a/tests/config/require-prettier.cjs b/tests/config/require-prettier.cjs deleted file mode 100644 index f0fa1e6d4..000000000 --- a/tests/config/require-prettier.cjs +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -const prettier = require("prettier"); - -module.exports = prettier; diff --git a/tests/config/require-standalone.cjs b/tests/config/require-standalone.cjs index 2f2c10bbc..8b9d52d3a 100644 --- a/tests/config/require-standalone.cjs +++ b/tests/config/require-standalone.cjs @@ -35,7 +35,7 @@ module.exports = { }; prettier.formatWithCursor($$$input, options); `, - { $$$input: input, $$$options: options, ...sandbox } + { $$$input: input, $$$options: options, ...sandbox }, ); }, @@ -57,7 +57,7 @@ module.exports = { $$$options: options, $$$devOptions: devOptions, ...sandbox, - } + }, ); }, }, diff --git a/tests/config/format-test.js b/tests/config/run-format-test.js similarity index 95% rename from tests/config/format-test.js rename to tests/config/run-format-test.js index 7c3a3ed74..afaa40686 100644 --- a/tests/config/format-test.js +++ b/tests/config/run-format-test.js @@ -1,13 +1,15 @@ import fs from "node:fs"; import path from "node:path"; import url from "node:url"; + import createEsmUtils from "esm-utils"; + import getPrettier from "./get-prettier.js"; import compileContract from "./utils/compile-contract.js"; -import createSnapshot from "./utils/create-snapshot.js"; -import visualizeEndOfLine from "./utils/visualize-end-of-line.js"; import consistentEndOfLine from "./utils/consistent-end-of-line.js"; +import createSnapshot from "./utils/create-snapshot.js"; import stringifyOptionsForTitle from "./utils/stringify-options-for-title.js"; +import visualizeEndOfLine from "./utils/visualize-end-of-line.js"; const { __dirname } = createEsmUtils(import.meta); @@ -25,7 +27,7 @@ const unstableTests = new Map( ? fixture : [fixture]; return [path.join(__dirname, "../format/", file), isUnstable]; - }) + }), ); // Here we add files that will not have the same AST after being formatted. @@ -35,7 +37,7 @@ const unstableAstTests = new Map( ? fixture : [fixture]; return [path.join(__dirname, "../format/", file), isAstUnstable]; - }) + }), ); const testsWithAstChanges = new Map( @@ -59,7 +61,7 @@ const testsWithAstChanges = new Map( ? fixture : [fixture]; return [path.join(__dirname, "../format/", file), compareBytecode]; - }) + }), ); const isUnstable = (filename, options) => { @@ -109,10 +111,10 @@ const shouldThrowOnFormat = (filename, options) => { const isTestDirectory = (dirname, name) => (dirname + path.sep).startsWith( - path.join(__dirname, "../format", name) + path.sep + path.join(__dirname, "../format", name) + path.sep, ); -function runSpec(fixtures, parsers, options) { +function runFormatTest(fixtures, parsers, options) { let { importMeta, snippets = [] } = fixtures.importMeta ? fixtures : { importMeta: fixtures }; @@ -121,7 +123,7 @@ function runSpec(fixtures, parsers, options) { // `IS_PARSER_INFERENCE_TESTS` mean to test `inferParser` on `standalone` const IS_PARSER_INFERENCE_TESTS = isTestDirectory( dirname, - "misc/parser-inference" + "misc/parser-inference", ); // `IS_ERROR_TESTS` mean to watch errors like: @@ -158,7 +160,7 @@ function runSpec(fixtures, parsers, options) { path.extname(basename) === ".snap" || !file.isFile() || basename[0] === "." || - basename === "jsfmt.spec.js" || + basename === "format.test.js" || // VSCode creates this file sometime https://github.com/microsoft/vscode/issues/105191 basename === "debug.log" ) { @@ -197,7 +199,7 @@ function runSpec(fixtures, parsers, options) { }; const shouldThrowOnMainParserFormat = shouldThrowOnFormat( name, - formatOptions + formatOptions, ); let mainParserFormatResult; @@ -266,13 +268,13 @@ async function runTest({ // Make sure output has consistent EOL expect(formatResult.eolVisualizedOutput).toEqual( - visualizeEndOfLine(consistentEndOfLine(formatResult.outputWithCursor)) + visualizeEndOfLine(consistentEndOfLine(formatResult.outputWithCursor)), ); // The result is assert to equals to `output` if (typeof output === "string") { expect(formatResult.eolVisualizedOutput).toEqual( - visualizeEndOfLine(output) + visualizeEndOfLine(output), ); return; } @@ -283,7 +285,7 @@ async function runTest({ parsers, formatOptions, CURSOR_PLACEHOLDER, - }) + }), ).toMatchSnapshot(); if (!FULL_TEST) { @@ -299,7 +301,7 @@ async function runTest({ const { eolVisualizedOutput: firstOutput, output } = formatResult; const { eolVisualizedOutput: secondOutput } = await format( output, - formatOptions + formatOptions, ); if (isUnstableTest) { // To keep eye on failed tests, this assert never supposed to pass, @@ -326,15 +328,15 @@ async function runTest({ if (!shouldSkipEolTest(code, formatResult.options)) { for (const eol of ["\r\n", "\r"]) { const { eolVisualizedOutput: output } = await format( - code.replace(/\n/g, eol), - formatOptions + code.replace(/\n/gu, eol), + formatOptions, ); // Only if `endOfLine: "auto"` the result will be different const expected = formatOptions.endOfLine === "auto" ? visualizeEndOfLine( // All `code` use `LF`, so the `eol` of result is always `LF` - formatResult.outputWithCursor.replace(/\n/g, eol) + formatResult.outputWithCursor.replace(/\n/gu, eol), ) : formatResult.eolVisualizedOutput; expect(output).toEqual(expected); @@ -344,7 +346,7 @@ async function runTest({ if (code.charAt(0) !== BOM) { const { eolVisualizedOutput: output } = await format( BOM + code, - formatOptions + formatOptions, ); const expected = BOM + formatResult.eolVisualizedOutput; expect(output).toEqual(expected); @@ -427,14 +429,14 @@ const insertCursor = (text, cursorOffset) => async function format(originalText, originalOptions) { const { text: input, options } = replacePlaceholders( originalText, - originalOptions + originalOptions, ); const inputWithCursor = insertCursor(input, options.cursorOffset); const prettier = await getPrettier(); const { formatted: output, cursorOffset } = await prettier.formatWithCursor( input, - options + options, ); const outputWithCursor = insertCursor(output, cursorOffset); const eolVisualizedOutput = visualizeEndOfLine(outputWithCursor); @@ -452,4 +454,4 @@ async function format(originalText, originalOptions) { }; } -export default runSpec; +export default runFormatTest; diff --git a/tests/config/setup.js b/tests/config/setup.js deleted file mode 100644 index 3d3b8b4c7..000000000 --- a/tests/config/setup.js +++ /dev/null @@ -1,3 +0,0 @@ -import runSpec from "./format-test.js"; - -globalThis.run_spec = runSpec; diff --git a/tests/config/utils/compile-contract.js b/tests/config/utils/compile-contract.js index 7a0474f8f..194eb0980 100644 --- a/tests/config/utils/compile-contract.js +++ b/tests/config/utils/compile-contract.js @@ -40,7 +40,7 @@ async function compileContract(filename, content) { ...byteCodes, [contractName]: compiledContracts[contractName].evm.bytecode.object, }), - {} + {}, ); } diff --git a/tests/config/utils/consistent-end-of-line.js b/tests/config/utils/consistent-end-of-line.js index e618ab542..ecedbf7b0 100644 --- a/tests/config/utils/consistent-end-of-line.js +++ b/tests/config/utils/consistent-end-of-line.js @@ -1,6 +1,6 @@ function consistentEndOfLine(text) { let firstEndOfLine; - return text.replace(/\r\n?|\n/g, (endOfLine) => { + return text.replace(/\r\n?|\n/gu, (endOfLine) => { firstEndOfLine = firstEndOfLine ?? endOfLine; return firstEndOfLine; }); diff --git a/tests/config/utils/create-snapshot.js b/tests/config/utils/create-snapshot.js index 5b122939a..1a898837f 100644 --- a/tests/config/utils/create-snapshot.js +++ b/tests/config/utils/create-snapshot.js @@ -1,6 +1,7 @@ import { wrap as raw } from "jest-snapshot-serializer-raw"; -import visualizeRange from "./visualize-range.js"; + import visualizeEndOfLine from "./visualize-end-of-line.js"; +import visualizeRange from "./visualize-range.js"; const SEPARATOR_WIDTH = 80; function printSeparator(description = "") { @@ -48,7 +49,7 @@ function printWidthIndicator(printWidth, offset) { function createSnapshot( formatResult, - { parsers, formatOptions, CURSOR_PLACEHOLDER } + { parsers, formatOptions, CURSOR_PLACEHOLDER }, ) { let { inputWithCursor: input, @@ -69,7 +70,7 @@ function createSnapshot( } input = visualizeRange(input, { rangeStart, rangeEnd }); - codeOffset = input.match(/^>?\s+1 \|/)[0].length + 1; + codeOffset = input.match(/^>?\s+1 \|/u)[0].length + 1; } if ("endOfLine" in formatOptions) { @@ -89,7 +90,7 @@ function createSnapshot( printSeparator("output"), output, printSeparator(), - ].join("\n") + ].join("\n"), ); } diff --git a/tests/config/utils/stringify-options-for-title.js b/tests/config/utils/stringify-options-for-title.js index 46921dc54..d25c671d5 100644 --- a/tests/config/utils/stringify-options-for-title.js +++ b/tests/config/utils/stringify-options-for-title.js @@ -4,7 +4,7 @@ function stringifyOptions(options) { ? undefined : value === Number.POSITIVE_INFINITY ? "Infinity" - : value + : value, ); return string === "{}" ? "" : string; diff --git a/tests/config/utils/visualize-end-of-line.js b/tests/config/utils/visualize-end-of-line.js index 9dec987e0..1db619aeb 100644 --- a/tests/config/utils/visualize-end-of-line.js +++ b/tests/config/utils/visualize-end-of-line.js @@ -1,5 +1,5 @@ function visualizeEndOfLine(text) { - return text.replace(/\r\n?|\n/g, (endOfLine) => { + return text.replace(/\r\n?|\n/gu, (endOfLine) => { switch (endOfLine) { case "\n": return "\n"; diff --git a/tests/config/utils/visualize-range.js b/tests/config/utils/visualize-range.js index 6d3762f7f..222bc7a6f 100644 --- a/tests/config/utils/visualize-range.js +++ b/tests/config/utils/visualize-range.js @@ -1,5 +1,5 @@ -import { LinesAndColumns } from "lines-and-columns"; import { codeFrameColumns } from "@babel/code-frame"; +import { LinesAndColumns } from "lines-and-columns"; const codeFrameColumnsOptions = { linesAbove: Number.POSITIVE_INFINITY, linesBelow: Number.POSITIVE_INFINITY, @@ -32,7 +32,7 @@ const visualizeRange = (text, { rangeStart = 0, rangeEnd = text.length }) => locationForRange(text, rangeStart, rangeEnd), rangeStart > rangeEnd ? { ...codeFrameColumnsOptions, message: "[Reversed range]" } - : codeFrameColumnsOptions + : codeFrameColumnsOptions, ); export default visualizeRange; diff --git a/tests/format/AddressPayable/__snapshots__/jsfmt.spec.js.snap b/tests/format/AddressPayable/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/AddressPayable/__snapshots__/jsfmt.spec.js.snap rename to tests/format/AddressPayable/__snapshots__/format.test.js.snap diff --git a/tests/format/AddressPayable/format.test.js b/tests/format/AddressPayable/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/AddressPayable/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/AddressPayable/jsfmt.spec.js b/tests/format/AddressPayable/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/AddressPayable/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/AllSolidityFeatures/__snapshots__/jsfmt.spec.js.snap b/tests/format/AllSolidityFeatures/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/AllSolidityFeatures/__snapshots__/jsfmt.spec.js.snap rename to tests/format/AllSolidityFeatures/__snapshots__/format.test.js.snap diff --git a/tests/format/AllSolidityFeatures/format.test.js b/tests/format/AllSolidityFeatures/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/AllSolidityFeatures/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/AllSolidityFeatures/jsfmt.spec.js b/tests/format/AllSolidityFeatures/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/AllSolidityFeatures/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/AllSolidityFeaturesV0.4.26/__snapshots__/jsfmt.spec.js.snap b/tests/format/AllSolidityFeaturesV0.4.26/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/AllSolidityFeaturesV0.4.26/__snapshots__/jsfmt.spec.js.snap rename to tests/format/AllSolidityFeaturesV0.4.26/__snapshots__/format.test.js.snap diff --git a/tests/format/AllSolidityFeaturesV0.4.26/format.test.js b/tests/format/AllSolidityFeaturesV0.4.26/format.test.js new file mode 100644 index 000000000..94898ac13 --- /dev/null +++ b/tests/format/AllSolidityFeaturesV0.4.26/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/AllSolidityFeaturesV0.4.26/jsfmt.spec.js b/tests/format/AllSolidityFeaturesV0.4.26/jsfmt.spec.js deleted file mode 100644 index fb953582e..000000000 --- a/tests/format/AllSolidityFeaturesV0.4.26/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/Arrays/__snapshots__/jsfmt.spec.js.snap b/tests/format/Arrays/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Arrays/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Arrays/__snapshots__/format.test.js.snap diff --git a/tests/format/Arrays/format.test.js b/tests/format/Arrays/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Arrays/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Arrays/jsfmt.spec.js b/tests/format/Arrays/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Arrays/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Assembly/__snapshots__/jsfmt.spec.js.snap b/tests/format/Assembly/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Assembly/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Assembly/__snapshots__/format.test.js.snap diff --git a/tests/format/Assembly/format.test.js b/tests/format/Assembly/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Assembly/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Assembly/jsfmt.spec.js b/tests/format/Assembly/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Assembly/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/AssemblyV0.4.26/__snapshots__/jsfmt.spec.js.snap b/tests/format/AssemblyV0.4.26/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/AssemblyV0.4.26/__snapshots__/jsfmt.spec.js.snap rename to tests/format/AssemblyV0.4.26/__snapshots__/format.test.js.snap diff --git a/tests/format/AssemblyV0.4.26/format.test.js b/tests/format/AssemblyV0.4.26/format.test.js new file mode 100644 index 000000000..94898ac13 --- /dev/null +++ b/tests/format/AssemblyV0.4.26/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/AssemblyV0.4.26/jsfmt.spec.js b/tests/format/AssemblyV0.4.26/jsfmt.spec.js deleted file mode 100644 index fb953582e..000000000 --- a/tests/format/AssemblyV0.4.26/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/BasicIterator/__snapshots__/jsfmt.spec.js.snap b/tests/format/BasicIterator/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/BasicIterator/__snapshots__/jsfmt.spec.js.snap rename to tests/format/BasicIterator/__snapshots__/format.test.js.snap diff --git a/tests/format/BasicIterator/format.test.js b/tests/format/BasicIterator/format.test.js new file mode 100644 index 000000000..94898ac13 --- /dev/null +++ b/tests/format/BasicIterator/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/BasicIterator/jsfmt.spec.js b/tests/format/BasicIterator/jsfmt.spec.js deleted file mode 100644 index fb953582e..000000000 --- a/tests/format/BasicIterator/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/BinaryOperators/__snapshots__/jsfmt.spec.js.snap b/tests/format/BinaryOperators/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/BinaryOperators/__snapshots__/jsfmt.spec.js.snap rename to tests/format/BinaryOperators/__snapshots__/format.test.js.snap diff --git a/tests/format/BinaryOperators/format.test.js b/tests/format/BinaryOperators/format.test.js new file mode 100644 index 000000000..b7b0a5e6d --- /dev/null +++ b/tests/format/BinaryOperators/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.5.8' }); diff --git a/tests/format/BinaryOperators/jsfmt.spec.js b/tests/format/BinaryOperators/jsfmt.spec.js deleted file mode 100644 index 946858815..000000000 --- a/tests/format/BinaryOperators/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.5.8' }); diff --git a/tests/format/BreakingChangesV0.7.4/__snapshots__/jsfmt.spec.js.snap b/tests/format/BreakingChangesV0.7.4/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/BreakingChangesV0.7.4/__snapshots__/jsfmt.spec.js.snap rename to tests/format/BreakingChangesV0.7.4/__snapshots__/format.test.js.snap diff --git a/tests/format/BreakingChangesV0.7.4/format.test.js b/tests/format/BreakingChangesV0.7.4/format.test.js new file mode 100644 index 000000000..057f5b05d --- /dev/null +++ b/tests/format/BreakingChangesV0.7.4/format.test.js @@ -0,0 +1,14 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.7.4' }); +runFormatTest(import.meta, ['solidity-parse'], { + compiler: '0.7.4', + bracketSpacing: true +}); +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.7.3' }); +runFormatTest(import.meta, ['solidity-parse'], { + compiler: '0.7.3', + bracketSpacing: true +}); +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { + bracketSpacing: true +}); diff --git a/tests/format/BreakingChangesV0.7.4/jsfmt.spec.js b/tests/format/BreakingChangesV0.7.4/jsfmt.spec.js deleted file mode 100644 index b64637462..000000000 --- a/tests/format/BreakingChangesV0.7.4/jsfmt.spec.js +++ /dev/null @@ -1,14 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.7.4' }); -run_spec(import.meta, ['solidity-parse'], { - compiler: '0.7.4', - bracketSpacing: true -}); -run_spec(import.meta, ['solidity-parse'], { compiler: '0.7.3' }); -run_spec(import.meta, ['solidity-parse'], { - compiler: '0.7.3', - bracketSpacing: true -}); -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { - bracketSpacing: true -}); diff --git a/tests/format/BreakingChangesV0.8.0/__snapshots__/jsfmt.spec.js.snap b/tests/format/BreakingChangesV0.8.0/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/BreakingChangesV0.8.0/__snapshots__/jsfmt.spec.js.snap rename to tests/format/BreakingChangesV0.8.0/__snapshots__/format.test.js.snap diff --git a/tests/format/BreakingChangesV0.8.0/format.test.js b/tests/format/BreakingChangesV0.8.0/format.test.js new file mode 100644 index 000000000..288dc45a8 --- /dev/null +++ b/tests/format/BreakingChangesV0.8.0/format.test.js @@ -0,0 +1,3 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.8.0' }); +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.7.0' }); diff --git a/tests/format/BreakingChangesV0.8.0/jsfmt.spec.js b/tests/format/BreakingChangesV0.8.0/jsfmt.spec.js deleted file mode 100644 index 037d673ba..000000000 --- a/tests/format/BreakingChangesV0.8.0/jsfmt.spec.js +++ /dev/null @@ -1,3 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { compiler: '0.8.0' }); -run_spec(import.meta, ['solidity-parse'], { compiler: '0.7.0' }); diff --git a/tests/format/Comments/__snapshots__/jsfmt.spec.js.snap b/tests/format/Comments/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Comments/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Comments/__snapshots__/format.test.js.snap diff --git a/tests/format/Comments/format.test.js b/tests/format/Comments/format.test.js new file mode 100644 index 000000000..109c063bb --- /dev/null +++ b/tests/format/Comments/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.4.24' }); diff --git a/tests/format/Comments/jsfmt.spec.js b/tests/format/Comments/jsfmt.spec.js deleted file mode 100644 index daacfb24c..000000000 --- a/tests/format/Comments/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.4.24' }); diff --git a/tests/format/Conditional/__snapshots__/jsfmt.spec.js.snap b/tests/format/Conditional/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Conditional/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Conditional/__snapshots__/format.test.js.snap diff --git a/tests/format/Conditional/format.test.js b/tests/format/Conditional/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Conditional/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Conditional/jsfmt.spec.js b/tests/format/Conditional/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Conditional/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Constructors/__snapshots__/jsfmt.spec.js.snap b/tests/format/Constructors/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Constructors/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Constructors/__snapshots__/format.test.js.snap diff --git a/tests/format/Constructors/format.test.js b/tests/format/Constructors/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Constructors/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Constructors/jsfmt.spec.js b/tests/format/Constructors/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Constructors/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/ContractDefinitions/__snapshots__/jsfmt.spec.js.snap b/tests/format/ContractDefinitions/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/ContractDefinitions/__snapshots__/jsfmt.spec.js.snap rename to tests/format/ContractDefinitions/__snapshots__/format.test.js.snap diff --git a/tests/format/ContractDefinitions/format.test.js b/tests/format/ContractDefinitions/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/ContractDefinitions/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/ContractDefinitions/jsfmt.spec.js b/tests/format/ContractDefinitions/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/ContractDefinitions/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/CustomErrors/__snapshots__/jsfmt.spec.js.snap b/tests/format/CustomErrors/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/CustomErrors/__snapshots__/jsfmt.spec.js.snap rename to tests/format/CustomErrors/__snapshots__/format.test.js.snap diff --git a/tests/format/CustomErrors/format.test.js b/tests/format/CustomErrors/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/CustomErrors/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/CustomErrors/jsfmt.spec.js b/tests/format/CustomErrors/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/CustomErrors/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/EnumDefinitions/__snapshots__/jsfmt.spec.js.snap b/tests/format/EnumDefinitions/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/EnumDefinitions/__snapshots__/jsfmt.spec.js.snap rename to tests/format/EnumDefinitions/__snapshots__/format.test.js.snap diff --git a/tests/format/EnumDefinitions/format.test.js b/tests/format/EnumDefinitions/format.test.js new file mode 100644 index 000000000..7bed92968 --- /dev/null +++ b/tests/format/EnumDefinitions/format.test.js @@ -0,0 +1,2 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/EnumDefinitions/jsfmt.spec.js b/tests/format/EnumDefinitions/jsfmt.spec.js deleted file mode 100644 index 993a81764..000000000 --- a/tests/format/EnumDefinitions/jsfmt.spec.js +++ /dev/null @@ -1,2 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/Etc/__snapshots__/jsfmt.spec.js.snap b/tests/format/Etc/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Etc/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Etc/__snapshots__/format.test.js.snap diff --git a/tests/format/Etc/format.test.js b/tests/format/Etc/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Etc/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Etc/jsfmt.spec.js b/tests/format/Etc/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Etc/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/ExperimentalTernaries/__snapshots__/jsfmt.spec.js.snap b/tests/format/ExperimentalTernaries/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/ExperimentalTernaries/__snapshots__/jsfmt.spec.js.snap rename to tests/format/ExperimentalTernaries/__snapshots__/format.test.js.snap diff --git a/tests/format/ExperimentalTernaries/format.test.js b/tests/format/ExperimentalTernaries/format.test.js new file mode 100644 index 000000000..d12aeb806 --- /dev/null +++ b/tests/format/ExperimentalTernaries/format.test.js @@ -0,0 +1,10 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { experimentalTernaries: true }); +runFormatTest(import.meta, ['solidity-parse'], { + experimentalTernaries: true, + tabWidth: 1 +}); +runFormatTest(import.meta, ['solidity-parse'], { + experimentalTernaries: true, + useTabs: true +}); diff --git a/tests/format/ExperimentalTernaries/jsfmt.spec.js b/tests/format/ExperimentalTernaries/jsfmt.spec.js deleted file mode 100644 index c79991703..000000000 --- a/tests/format/ExperimentalTernaries/jsfmt.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { experimentalTernaries: true }); -run_spec(import.meta, ['solidity-parse'], { - experimentalTernaries: true, - tabWidth: 1 -}); -run_spec(import.meta, ['solidity-parse'], { - experimentalTernaries: true, - useTabs: true -}); diff --git a/tests/format/ForStatements/__snapshots__/jsfmt.spec.js.snap b/tests/format/ForStatements/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/ForStatements/__snapshots__/jsfmt.spec.js.snap rename to tests/format/ForStatements/__snapshots__/format.test.js.snap diff --git a/tests/format/ForStatements/format.test.js b/tests/format/ForStatements/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/ForStatements/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/ForStatements/jsfmt.spec.js b/tests/format/ForStatements/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/ForStatements/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/FunctionCalls/__snapshots__/jsfmt.spec.js.snap b/tests/format/FunctionCalls/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/FunctionCalls/__snapshots__/jsfmt.spec.js.snap rename to tests/format/FunctionCalls/__snapshots__/format.test.js.snap diff --git a/tests/format/FunctionCalls/format.test.js b/tests/format/FunctionCalls/format.test.js new file mode 100644 index 000000000..7bed92968 --- /dev/null +++ b/tests/format/FunctionCalls/format.test.js @@ -0,0 +1,2 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/FunctionCalls/jsfmt.spec.js b/tests/format/FunctionCalls/jsfmt.spec.js deleted file mode 100644 index 993a81764..000000000 --- a/tests/format/FunctionCalls/jsfmt.spec.js +++ /dev/null @@ -1,2 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/FunctionDefinitions/__snapshots__/jsfmt.spec.js.snap b/tests/format/FunctionDefinitions/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/FunctionDefinitions/__snapshots__/jsfmt.spec.js.snap rename to tests/format/FunctionDefinitions/__snapshots__/format.test.js.snap diff --git a/tests/format/FunctionDefinitions/format.test.js b/tests/format/FunctionDefinitions/format.test.js new file mode 100644 index 000000000..c606c3d28 --- /dev/null +++ b/tests/format/FunctionDefinitions/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.8.0' }); diff --git a/tests/format/FunctionDefinitions/jsfmt.spec.js b/tests/format/FunctionDefinitions/jsfmt.spec.js deleted file mode 100644 index 41e6db5a6..000000000 --- a/tests/format/FunctionDefinitions/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.8.0' }); diff --git a/tests/format/FunctionDefinitionsV0.5.0/__snapshots__/jsfmt.spec.js.snap b/tests/format/FunctionDefinitionsV0.5.0/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/FunctionDefinitionsV0.5.0/__snapshots__/jsfmt.spec.js.snap rename to tests/format/FunctionDefinitionsV0.5.0/__snapshots__/format.test.js.snap diff --git a/tests/format/FunctionDefinitionsV0.5.0/format.test.js b/tests/format/FunctionDefinitionsV0.5.0/format.test.js new file mode 100644 index 000000000..12273b032 --- /dev/null +++ b/tests/format/FunctionDefinitionsV0.5.0/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.5.0' }); diff --git a/tests/format/FunctionDefinitionsV0.5.0/jsfmt.spec.js b/tests/format/FunctionDefinitionsV0.5.0/jsfmt.spec.js deleted file mode 100644 index 417487a97..000000000 --- a/tests/format/FunctionDefinitionsV0.5.0/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.5.0' }); diff --git a/tests/format/HexLiteral/__snapshots__/jsfmt.spec.js.snap b/tests/format/HexLiteral/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/HexLiteral/__snapshots__/jsfmt.spec.js.snap rename to tests/format/HexLiteral/__snapshots__/format.test.js.snap diff --git a/tests/format/HexLiteral/format.test.js b/tests/format/HexLiteral/format.test.js new file mode 100644 index 000000000..6defea148 --- /dev/null +++ b/tests/format/HexLiteral/format.test.js @@ -0,0 +1,8 @@ +runFormatTest(import.meta, ['solidity-parse'], { + compiler: '0.8.6', + singleQuote: true +}); +runFormatTest(import.meta, ['solidity-parse'], { + compiler: '0.8.6', + singleQuote: false +}); diff --git a/tests/format/HexLiteral/jsfmt.spec.js b/tests/format/HexLiteral/jsfmt.spec.js deleted file mode 100644 index ac4400e7d..000000000 --- a/tests/format/HexLiteral/jsfmt.spec.js +++ /dev/null @@ -1,8 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { - compiler: '0.8.6', - singleQuote: true -}); -run_spec(import.meta, ['solidity-parse'], { - compiler: '0.8.6', - singleQuote: false -}); diff --git a/tests/format/IfStatements/__snapshots__/jsfmt.spec.js.snap b/tests/format/IfStatements/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/IfStatements/__snapshots__/jsfmt.spec.js.snap rename to tests/format/IfStatements/__snapshots__/format.test.js.snap diff --git a/tests/format/IfStatements/format.test.js b/tests/format/IfStatements/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/IfStatements/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/IfStatements/jsfmt.spec.js b/tests/format/IfStatements/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/IfStatements/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Immutable/__snapshots__/jsfmt.spec.js.snap b/tests/format/Immutable/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Immutable/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Immutable/__snapshots__/format.test.js.snap diff --git a/tests/format/Immutable/format.test.js b/tests/format/Immutable/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Immutable/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Immutable/jsfmt.spec.js b/tests/format/Immutable/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Immutable/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/ImportDirective/__snapshots__/jsfmt.spec.js.snap b/tests/format/ImportDirective/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/ImportDirective/__snapshots__/jsfmt.spec.js.snap rename to tests/format/ImportDirective/__snapshots__/format.test.js.snap diff --git a/tests/format/ImportDirective/format.test.js b/tests/format/ImportDirective/format.test.js new file mode 100644 index 000000000..7bed92968 --- /dev/null +++ b/tests/format/ImportDirective/format.test.js @@ -0,0 +1,2 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/ImportDirective/jsfmt.spec.js b/tests/format/ImportDirective/jsfmt.spec.js deleted file mode 100644 index 993a81764..000000000 --- a/tests/format/ImportDirective/jsfmt.spec.js +++ /dev/null @@ -1,2 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/Inbox/__snapshots__/jsfmt.spec.js.snap b/tests/format/Inbox/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Inbox/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Inbox/__snapshots__/format.test.js.snap diff --git a/tests/format/Inbox/format.test.js b/tests/format/Inbox/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Inbox/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Inbox/jsfmt.spec.js b/tests/format/Inbox/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Inbox/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/IndexOf/__snapshots__/jsfmt.spec.js.snap b/tests/format/IndexOf/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/IndexOf/__snapshots__/jsfmt.spec.js.snap rename to tests/format/IndexOf/__snapshots__/format.test.js.snap diff --git a/tests/format/IndexOf/format.test.js b/tests/format/IndexOf/format.test.js new file mode 100644 index 000000000..94898ac13 --- /dev/null +++ b/tests/format/IndexOf/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/IndexOf/jsfmt.spec.js b/tests/format/IndexOf/jsfmt.spec.js deleted file mode 100644 index fb953582e..000000000 --- a/tests/format/IndexOf/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.4.26' }); diff --git a/tests/format/IndexRangeAccess/__snapshots__/jsfmt.spec.js.snap b/tests/format/IndexRangeAccess/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/IndexRangeAccess/__snapshots__/jsfmt.spec.js.snap rename to tests/format/IndexRangeAccess/__snapshots__/format.test.js.snap diff --git a/tests/format/IndexRangeAccess/format.test.js b/tests/format/IndexRangeAccess/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/IndexRangeAccess/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/IndexRangeAccess/jsfmt.spec.js b/tests/format/IndexRangeAccess/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/IndexRangeAccess/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/InheritanceSpecifier/__snapshots__/jsfmt.spec.js.snap b/tests/format/InheritanceSpecifier/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/InheritanceSpecifier/__snapshots__/jsfmt.spec.js.snap rename to tests/format/InheritanceSpecifier/__snapshots__/format.test.js.snap diff --git a/tests/format/InheritanceSpecifier/format.test.js b/tests/format/InheritanceSpecifier/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/InheritanceSpecifier/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/InheritanceSpecifier/jsfmt.spec.js b/tests/format/InheritanceSpecifier/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/InheritanceSpecifier/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Issues/__snapshots__/jsfmt.spec.js.snap b/tests/format/Issues/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Issues/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Issues/__snapshots__/format.test.js.snap diff --git a/tests/format/Issues/format.test.js b/tests/format/Issues/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Issues/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Issues/jsfmt.spec.js b/tests/format/Issues/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Issues/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Libraries/__snapshots__/jsfmt.spec.js.snap b/tests/format/Libraries/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Libraries/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Libraries/__snapshots__/format.test.js.snap diff --git a/tests/format/Libraries/format.test.js b/tests/format/Libraries/format.test.js new file mode 100644 index 000000000..7bed92968 --- /dev/null +++ b/tests/format/Libraries/format.test.js @@ -0,0 +1,2 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/Libraries/jsfmt.spec.js b/tests/format/Libraries/jsfmt.spec.js deleted file mode 100644 index 993a81764..000000000 --- a/tests/format/Libraries/jsfmt.spec.js +++ /dev/null @@ -1,2 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/Markdown/__snapshots__/jsfmt.spec.js.snap b/tests/format/Markdown/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Markdown/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Markdown/__snapshots__/format.test.js.snap diff --git a/tests/format/Markdown/format.test.js b/tests/format/Markdown/format.test.js new file mode 100644 index 000000000..aa8606946 --- /dev/null +++ b/tests/format/Markdown/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['markdown']); diff --git a/tests/format/Markdown/jsfmt.spec.js b/tests/format/Markdown/jsfmt.spec.js deleted file mode 100644 index cca2da906..000000000 --- a/tests/format/Markdown/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['markdown']); diff --git a/tests/format/MemberAccess/__snapshots__/jsfmt.spec.js.snap b/tests/format/MemberAccess/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/MemberAccess/__snapshots__/jsfmt.spec.js.snap rename to tests/format/MemberAccess/__snapshots__/format.test.js.snap diff --git a/tests/format/MemberAccess/format.test.js b/tests/format/MemberAccess/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/MemberAccess/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/MemberAccess/jsfmt.spec.js b/tests/format/MemberAccess/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/MemberAccess/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/ModifierDefinitions/__snapshots__/jsfmt.spec.js.snap b/tests/format/ModifierDefinitions/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/ModifierDefinitions/__snapshots__/jsfmt.spec.js.snap rename to tests/format/ModifierDefinitions/__snapshots__/format.test.js.snap diff --git a/tests/format/ModifierDefinitions/format.test.js b/tests/format/ModifierDefinitions/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/ModifierDefinitions/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/ModifierDefinitions/jsfmt.spec.js b/tests/format/ModifierDefinitions/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/ModifierDefinitions/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/ModifierInvocations/__snapshots__/jsfmt.spec.js.snap b/tests/format/ModifierInvocations/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/ModifierInvocations/__snapshots__/jsfmt.spec.js.snap rename to tests/format/ModifierInvocations/__snapshots__/format.test.js.snap diff --git a/tests/format/ModifierInvocations/format.test.js b/tests/format/ModifierInvocations/format.test.js new file mode 100644 index 000000000..c606c3d28 --- /dev/null +++ b/tests/format/ModifierInvocations/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.8.0' }); diff --git a/tests/format/ModifierInvocations/jsfmt.spec.js b/tests/format/ModifierInvocations/jsfmt.spec.js deleted file mode 100644 index 41e6db5a6..000000000 --- a/tests/format/ModifierInvocations/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.8.0' }); diff --git a/tests/format/MultipartStrings/__snapshots__/jsfmt.spec.js.snap b/tests/format/MultipartStrings/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/MultipartStrings/__snapshots__/jsfmt.spec.js.snap rename to tests/format/MultipartStrings/__snapshots__/format.test.js.snap diff --git a/tests/format/MultipartStrings/format.test.js b/tests/format/MultipartStrings/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/MultipartStrings/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/MultipartStrings/jsfmt.spec.js b/tests/format/MultipartStrings/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/MultipartStrings/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/NameValueExpression/__snapshots__/jsfmt.spec.js.snap b/tests/format/NameValueExpression/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/NameValueExpression/__snapshots__/jsfmt.spec.js.snap rename to tests/format/NameValueExpression/__snapshots__/format.test.js.snap diff --git a/tests/format/NameValueExpression/format.test.js b/tests/format/NameValueExpression/format.test.js new file mode 100644 index 000000000..7bed92968 --- /dev/null +++ b/tests/format/NameValueExpression/format.test.js @@ -0,0 +1,2 @@ +runFormatTest(import.meta, ['solidity-parse']); +runFormatTest(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/NameValueExpression/jsfmt.spec.js b/tests/format/NameValueExpression/jsfmt.spec.js deleted file mode 100644 index 993a81764..000000000 --- a/tests/format/NameValueExpression/jsfmt.spec.js +++ /dev/null @@ -1,2 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); -run_spec(import.meta, ['solidity-parse'], { bracketSpacing: true }); diff --git a/tests/format/NumberLiteral/__snapshots__/jsfmt.spec.js.snap b/tests/format/NumberLiteral/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/NumberLiteral/__snapshots__/jsfmt.spec.js.snap rename to tests/format/NumberLiteral/__snapshots__/format.test.js.snap diff --git a/tests/format/NumberLiteral/format.test.js b/tests/format/NumberLiteral/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/NumberLiteral/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/NumberLiteral/jsfmt.spec.js b/tests/format/NumberLiteral/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/NumberLiteral/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Ownable/__snapshots__/jsfmt.spec.js.snap b/tests/format/Ownable/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Ownable/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Ownable/__snapshots__/format.test.js.snap diff --git a/tests/format/Ownable/format.test.js b/tests/format/Ownable/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Ownable/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Ownable/jsfmt.spec.js b/tests/format/Ownable/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Ownable/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Parentheses/__snapshots__/jsfmt.spec.js.snap b/tests/format/Parentheses/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Parentheses/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Parentheses/__snapshots__/format.test.js.snap diff --git a/tests/format/Parentheses/format.test.js b/tests/format/Parentheses/format.test.js new file mode 100644 index 000000000..fdf54fb8a --- /dev/null +++ b/tests/format/Parentheses/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.8.6' }); diff --git a/tests/format/Parentheses/jsfmt.spec.js b/tests/format/Parentheses/jsfmt.spec.js deleted file mode 100644 index 8c772cba0..000000000 --- a/tests/format/Parentheses/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.8.6' }); diff --git a/tests/format/Pragma/__snapshots__/jsfmt.spec.js.snap b/tests/format/Pragma/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Pragma/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Pragma/__snapshots__/format.test.js.snap diff --git a/tests/format/Pragma/format.test.js b/tests/format/Pragma/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Pragma/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Pragma/jsfmt.spec.js b/tests/format/Pragma/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Pragma/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/PrettierIgnore/__snapshots__/jsfmt.spec.js.snap b/tests/format/PrettierIgnore/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/PrettierIgnore/__snapshots__/jsfmt.spec.js.snap rename to tests/format/PrettierIgnore/__snapshots__/format.test.js.snap diff --git a/tests/format/PrettierIgnore/format.test.js b/tests/format/PrettierIgnore/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/PrettierIgnore/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/PrettierIgnore/jsfmt.spec.js b/tests/format/PrettierIgnore/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/PrettierIgnore/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Proxy/__snapshots__/jsfmt.spec.js.snap b/tests/format/Proxy/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Proxy/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Proxy/__snapshots__/format.test.js.snap diff --git a/tests/format/Proxy/format.test.js b/tests/format/Proxy/format.test.js new file mode 100644 index 000000000..109c063bb --- /dev/null +++ b/tests/format/Proxy/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.4.24' }); diff --git a/tests/format/Proxy/jsfmt.spec.js b/tests/format/Proxy/jsfmt.spec.js deleted file mode 100644 index daacfb24c..000000000 --- a/tests/format/Proxy/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.4.24' }); diff --git a/tests/format/RespectDefaultOptions/__snapshots__/jsfmt.spec.js.snap b/tests/format/RespectDefaultOptions/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/RespectDefaultOptions/__snapshots__/jsfmt.spec.js.snap rename to tests/format/RespectDefaultOptions/__snapshots__/format.test.js.snap diff --git a/tests/format/RespectDefaultOptions/format.test.js b/tests/format/RespectDefaultOptions/format.test.js new file mode 100644 index 000000000..563faa86a --- /dev/null +++ b/tests/format/RespectDefaultOptions/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['babel']); diff --git a/tests/format/RespectDefaultOptions/jsfmt.spec.js b/tests/format/RespectDefaultOptions/jsfmt.spec.js deleted file mode 100644 index 21d1d2cb5..000000000 --- a/tests/format/RespectDefaultOptions/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['babel']); diff --git a/tests/format/SampleCrowdsale/__snapshots__/jsfmt.spec.js.snap b/tests/format/SampleCrowdsale/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/SampleCrowdsale/__snapshots__/jsfmt.spec.js.snap rename to tests/format/SampleCrowdsale/__snapshots__/format.test.js.snap diff --git a/tests/format/SampleCrowdsale/format.test.js b/tests/format/SampleCrowdsale/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/SampleCrowdsale/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/SampleCrowdsale/jsfmt.spec.js b/tests/format/SampleCrowdsale/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/SampleCrowdsale/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/SimpleAuction/__snapshots__/jsfmt.spec.js.snap b/tests/format/SimpleAuction/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/SimpleAuction/__snapshots__/jsfmt.spec.js.snap rename to tests/format/SimpleAuction/__snapshots__/format.test.js.snap diff --git a/tests/format/SimpleAuction/format.test.js b/tests/format/SimpleAuction/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/SimpleAuction/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/SimpleAuction/jsfmt.spec.js b/tests/format/SimpleAuction/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/SimpleAuction/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/SimpleStorage/__snapshots__/jsfmt.spec.js.snap b/tests/format/SimpleStorage/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/SimpleStorage/__snapshots__/jsfmt.spec.js.snap rename to tests/format/SimpleStorage/__snapshots__/format.test.js.snap diff --git a/tests/format/SimpleStorage/format.test.js b/tests/format/SimpleStorage/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/SimpleStorage/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/SimpleStorage/jsfmt.spec.js b/tests/format/SimpleStorage/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/SimpleStorage/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/SplittableCommodity/__snapshots__/jsfmt.spec.js.snap b/tests/format/SplittableCommodity/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/SplittableCommodity/__snapshots__/jsfmt.spec.js.snap rename to tests/format/SplittableCommodity/__snapshots__/format.test.js.snap diff --git a/tests/format/SplittableCommodity/format.test.js b/tests/format/SplittableCommodity/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/SplittableCommodity/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/SplittableCommodity/jsfmt.spec.js b/tests/format/SplittableCommodity/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/SplittableCommodity/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/StateVariableDeclarations/__snapshots__/jsfmt.spec.js.snap b/tests/format/StateVariableDeclarations/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/StateVariableDeclarations/__snapshots__/jsfmt.spec.js.snap rename to tests/format/StateVariableDeclarations/__snapshots__/format.test.js.snap diff --git a/tests/format/StateVariableDeclarations/format.test.js b/tests/format/StateVariableDeclarations/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/StateVariableDeclarations/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/StateVariableDeclarations/jsfmt.spec.js b/tests/format/StateVariableDeclarations/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/StateVariableDeclarations/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/StringLiteral/__snapshots__/jsfmt.spec.js.snap b/tests/format/StringLiteral/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/StringLiteral/__snapshots__/jsfmt.spec.js.snap rename to tests/format/StringLiteral/__snapshots__/format.test.js.snap diff --git a/tests/format/StringLiteral/format.test.js b/tests/format/StringLiteral/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/StringLiteral/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/StringLiteral/jsfmt.spec.js b/tests/format/StringLiteral/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/StringLiteral/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/StyleGuide/__snapshots__/jsfmt.spec.js.snap b/tests/format/StyleGuide/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/StyleGuide/__snapshots__/jsfmt.spec.js.snap rename to tests/format/StyleGuide/__snapshots__/format.test.js.snap diff --git a/tests/format/StyleGuide/format.test.js b/tests/format/StyleGuide/format.test.js new file mode 100644 index 000000000..12273b032 --- /dev/null +++ b/tests/format/StyleGuide/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.5.0' }); diff --git a/tests/format/StyleGuide/jsfmt.spec.js b/tests/format/StyleGuide/jsfmt.spec.js deleted file mode 100644 index 417487a97..000000000 --- a/tests/format/StyleGuide/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { compiler: '0.5.0' }); diff --git a/tests/format/TryCatch/__snapshots__/jsfmt.spec.js.snap b/tests/format/TryCatch/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/TryCatch/__snapshots__/jsfmt.spec.js.snap rename to tests/format/TryCatch/__snapshots__/format.test.js.snap diff --git a/tests/format/TryCatch/format.test.js b/tests/format/TryCatch/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/TryCatch/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/TryCatch/jsfmt.spec.js b/tests/format/TryCatch/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/TryCatch/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/Tuples/__snapshots__/jsfmt.spec.js.snap b/tests/format/Tuples/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/Tuples/__snapshots__/jsfmt.spec.js.snap rename to tests/format/Tuples/__snapshots__/format.test.js.snap diff --git a/tests/format/Tuples/format.test.js b/tests/format/Tuples/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/Tuples/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/Tuples/jsfmt.spec.js b/tests/format/Tuples/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/Tuples/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/TypeDefinition/__snapshots__/jsfmt.spec.js.snap b/tests/format/TypeDefinition/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/TypeDefinition/__snapshots__/jsfmt.spec.js.snap rename to tests/format/TypeDefinition/__snapshots__/format.test.js.snap diff --git a/tests/format/TypeDefinition/format.test.js b/tests/format/TypeDefinition/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/TypeDefinition/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/TypeDefinition/jsfmt.spec.js b/tests/format/TypeDefinition/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/TypeDefinition/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/WhileStatements/__snapshots__/jsfmt.spec.js.snap b/tests/format/WhileStatements/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/WhileStatements/__snapshots__/jsfmt.spec.js.snap rename to tests/format/WhileStatements/__snapshots__/format.test.js.snap diff --git a/tests/format/WhileStatements/format.test.js b/tests/format/WhileStatements/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/WhileStatements/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/WhileStatements/jsfmt.spec.js b/tests/format/WhileStatements/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/WhileStatements/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']); diff --git a/tests/format/WrongCompiler/__snapshots__/jsfmt.spec.js.snap b/tests/format/WrongCompiler/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/WrongCompiler/__snapshots__/jsfmt.spec.js.snap rename to tests/format/WrongCompiler/__snapshots__/format.test.js.snap diff --git a/tests/format/WrongCompiler/format.test.js b/tests/format/WrongCompiler/format.test.js new file mode 100644 index 000000000..2b6fb0aba --- /dev/null +++ b/tests/format/WrongCompiler/format.test.js @@ -0,0 +1,10 @@ +// Should warn twice +runFormatTest(import.meta, ['solidity-parse'], { compiler: '0.8.4' }); +// Should warn once +runFormatTest(import.meta, ['solidity-parse'], { + compiler: 'v0.7.5-nightly.2020.11.9+commit.41f50365' +}); +// Should not warn +runFormatTest(import.meta, ['solidity-parse'], { + compiler: 'v0.7.3+commit.9bfce1f6' +}); diff --git a/tests/format/WrongCompiler/jsfmt.spec.js b/tests/format/WrongCompiler/jsfmt.spec.js deleted file mode 100644 index 0e6bb7941..000000000 --- a/tests/format/WrongCompiler/jsfmt.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -// Should warn twice -run_spec(import.meta, ['solidity-parse'], { compiler: '0.8.4' }); -// Should warn once -run_spec(import.meta, ['solidity-parse'], { - compiler: 'v0.7.5-nightly.2020.11.9+commit.41f50365' -}); -// Should not warn -run_spec(import.meta, ['solidity-parse'], { - compiler: 'v0.7.3+commit.9bfce1f6' -}); diff --git a/tests/format/quotes/__snapshots__/jsfmt.spec.js.snap b/tests/format/quotes/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/quotes/__snapshots__/jsfmt.spec.js.snap rename to tests/format/quotes/__snapshots__/format.test.js.snap diff --git a/tests/format/quotes/format.test.js b/tests/format/quotes/format.test.js new file mode 100644 index 000000000..0ee502339 --- /dev/null +++ b/tests/format/quotes/format.test.js @@ -0,0 +1,2 @@ +runFormatTest(import.meta, ['solidity-parse'], { singleQuote: true }); +runFormatTest(import.meta, ['solidity-parse'], { singleQuote: false }); diff --git a/tests/format/quotes/jsfmt.spec.js b/tests/format/quotes/jsfmt.spec.js deleted file mode 100644 index 3272026cc..000000000 --- a/tests/format/quotes/jsfmt.spec.js +++ /dev/null @@ -1,2 +0,0 @@ -run_spec(import.meta, ['solidity-parse'], { singleQuote: true }); -run_spec(import.meta, ['solidity-parse'], { singleQuote: false }); diff --git a/tests/format/strings/__snapshots__/jsfmt.spec.js.snap b/tests/format/strings/__snapshots__/format.test.js.snap similarity index 100% rename from tests/format/strings/__snapshots__/jsfmt.spec.js.snap rename to tests/format/strings/__snapshots__/format.test.js.snap diff --git a/tests/format/strings/format.test.js b/tests/format/strings/format.test.js new file mode 100644 index 000000000..2ae629864 --- /dev/null +++ b/tests/format/strings/format.test.js @@ -0,0 +1 @@ +runFormatTest(import.meta, ['solidity-parse']); diff --git a/tests/format/strings/jsfmt.spec.js b/tests/format/strings/jsfmt.spec.js deleted file mode 100644 index 765dd60a6..000000000 --- a/tests/format/strings/jsfmt.spec.js +++ /dev/null @@ -1 +0,0 @@ -run_spec(import.meta, ['solidity-parse']);