mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-22 22:33:13 +03:00
Make phantom type tests work when run from any directory
This commit is contained in:
parent
ae15334993
commit
912ed3ded4
@ -9,7 +9,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "elm make --docs=/tmp/docs.json && elm-format src/ --validate && elm-test && npm run phantom-tests && elm-review && elm-xref",
|
||||
"phantom-tests": "(cd phantom-type-tests && node ./run-phantom-tests.js)",
|
||||
"phantom-tests": "node phantom-type-tests/run.js",
|
||||
"test:watch": "npx elm-test --watch"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -1,11 +1,12 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { execSync } = require("child_process");
|
||||
|
||||
const files = fs.readdirSync(__dirname);
|
||||
const elmFiles = files.filter(file => file.endsWith(".elm"));
|
||||
|
||||
elmFiles.forEach(elmFile => {
|
||||
const expectedOutput = fs.readFileSync(`${elmFile.slice(0, -4)}.txt`, 'utf8');
|
||||
const expectedOutput = fs.readFileSync(path.join(__dirname, `${elmFile.slice(0, -4)}.txt`), 'utf8');
|
||||
|
||||
try {
|
||||
const output = execSync(`elm make ./${elmFile}`, {encoding:"utf8", stdio: 'pipe', cwd: __dirname}).toString();
|
Loading…
Reference in New Issue
Block a user