diff --git a/test/fixtures/assignment.expected.js b/test/fixtures/assignment.expected.js deleted file mode 100644 index fbeff1a8..00000000 --- a/test/fixtures/assignment.expected.js +++ /dev/null @@ -1,6 +0,0 @@ -x = 10; -y = 20; -z = 30; -x = y = z = w = 50; -reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally_long_var = 10; -reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally_long_var = x = y = 10; diff --git a/test/fixtures/assignment.js b/test/fixtures/assignment.js deleted file mode 100644 index c84ae2c9..00000000 --- a/test/fixtures/assignment.js +++ /dev/null @@ -1,6 +0,0 @@ -x = 10; -y = 20; -z=30; -x = y = z = w = 50; -reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally_long_var = 10; -reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally_long_var = x = y = 10; diff --git a/test/fixtures/binaryexpr.expected.js b/test/fixtures/binaryexpr.expected.js deleted file mode 100644 index 920c03cc..00000000 --- a/test/fixtures/binaryexpr.expected.js +++ /dev/null @@ -1,6 +0,0 @@ -x && y || z; -x | y & z; -x + y + z + w; -reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally_long_var || - foo || - bar + z; diff --git a/test/fixtures/binaryexpr.js b/test/fixtures/binaryexpr.js deleted file mode 100644 index fbcfe430..00000000 --- a/test/fixtures/binaryexpr.js +++ /dev/null @@ -1,5 +0,0 @@ -x && y || z -x | y & z -x + y + z +w - -reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeally_long_var || foo || bar + z diff --git a/test/index.js b/test/index.js deleted file mode 100644 index 4a084051..00000000 --- a/test/index.js +++ /dev/null @@ -1,29 +0,0 @@ -const fs = require("fs"); -const { join } = require("path"); -const glob = require("glob"); - -const jscodefmt = require("../"); - -glob("./fixtures/**/*.js", function(err, files) { - if(err) { throw err }; - runFixtureTests(files.filter(file => !file.includes(".expected.js"))); -}); - -function runFixtureTests(files) { - files.forEach(file => { - const expectedFile = file.replace(/\.js$/, ".expected.js"); - const src = fs.readFileSync(file); - const formatted = jscodefmt.format(src, { printWidth: 60 }); - - if(fs.existsSync(expectedFile)) { - const expected = fs.readFileSync(expectedFile, "utf8"); - - if(formatted !== expected) { - throw new Error("Failure: " + file + "\n" + formatted + "\ndoes not equal\n" + expected); - } - } - else { - fs.writeFileSync(expectedFile, formatted, "utf8"); - } - }); -}