diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bd05e9c2..a2f6c90f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -44,21 +44,9 @@ jobs: env: NO_ELM_TOOLING_INSTALL: 1 - - name: elm-tooling install - run: npx --no-install elm-tooling install + - run: npx elm-tooling install - - name: Flow - run: npx --no-install flow check + - run: node print.js - - name: ESLint - run: npx --no-install eslint --report-unused-disable-directives . - - - name: Prettier - run: npx --no-install prettier --check . - - - name: elm-format - run: npx --no-install elm-format --validate elm - - - name: elm-review - run: npx --no-install elm-review - working-directory: elm + - run: npx node ../bin/elm-test --color + working-directory: example-application diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 73105699..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Test - -on: - push: - branches: - - 'master' - pull_request: - -jobs: - main: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - # Node.js 12, 14 and 16 aren’t supported on the macOS arm64 runners. - os: [ubuntu-latest, macOS-15-intel, windows-latest] - node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x] - # Also have a test on macOS arm64. - include: - - os: macOS-latest - node-version: 24.x - - env: - ELM_HOME: '${{ github.workspace }}/elm-stuff/elm-home' - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: '${{ matrix.node-version }}' - - - name: Cache node_modules - id: cache-node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} - - - name: Cache ELM_HOME - uses: actions/cache@v4 - with: - path: '${{ env.ELM_HOME }}' - key: elm-${{ matrix.os }}-${{ hashFiles('elm-tooling.json', 'elm/**/elm.json', 'example-*/**/elm.json', 'tests/**/elm.json') }} - - - name: npm ci - if: steps.cache-node_modules.outputs.cache-hit != 'true' - run: npm ci - env: - NO_ELM_TOOLING_INSTALL: 1 - - - name: install mocha 9 - if: steps.cache-node_modules.outputs.cache-hit != 'true' && (matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x') - run: npm install mocha@9 - - - name: elm-tooling install - run: npx --no-install elm-tooling install - - - name: Mocha - run: npx --no-install mocha tests - - - name: elm-test - run: npm run elm-test diff --git a/elm/src/Test/Reporter/Console.elm b/elm/src/Test/Reporter/Console.elm index 00ca095a..44d8c360 100644 --- a/elm/src/Test/Reporter/Console.elm +++ b/elm/src/Test/Reporter/Console.elm @@ -210,10 +210,10 @@ reportSummary useColor { todos, passed, failed, duration } autoFail = headline = case headlineResult of Ok str -> - underline (green ("\n" ++ str ++ "\n\n")) + (green ("\n" ++ str ++ "\n\n")) Err ( colorize, str, suffix ) -> - [ underline (colorize ("\n" ++ str)) + [ (colorize ("\n" ++ str)) , colorize (suffix ++ "\n\n") ] |> Text.concat diff --git a/lib/Generate.js b/lib/Generate.js index e6aec134..8b927be4 100644 --- a/lib/Generate.js +++ b/lib/Generate.js @@ -274,6 +274,7 @@ function generateElmReportVariant( return 'JUnitReport'; case 'console': if (supportsColor) { + console.log('ConsoleReport UseColor'); return 'ConsoleReport UseColor'; } else { return 'ConsoleReport Monochrome'; diff --git a/lib/Supervisor.js b/lib/Supervisor.js index 22ddbf2f..901d259e 100644 --- a/lib/Supervisor.js +++ b/lib/Supervisor.js @@ -54,6 +54,7 @@ function run( } break; case 'summary': + console.log(JSON.stringify(makeWindowsSafe(result.summary))); console.log(makeWindowsSafe(result.summary)); break; default: @@ -161,6 +162,7 @@ function run( } var response = JSON.parse(data); + console.log('READ', response); switch (response.type) { case 'FINISHED': diff --git a/print.js b/print.js new file mode 100644 index 00000000..90a44339 --- /dev/null +++ b/print.js @@ -0,0 +1,7 @@ +console.log('\u001B[7mThis text is inverted\u001B[27m'); +console.log('\x1b[31mThis text is red\x1b[0m'); +console.log('\u001b[31mThis text is red\u001b[0m'); +console.log('\u001b[31m\nThis text is red\u001b[0m'); +console.log( + '\u001b[31mTEST RUN FAILED\u001b[39m\u001b[31m\n\n\u001b[39m\u001b[2mDuration: \u001b[22m154 ms\n\u001b[2mPassed: \u001b[22m3\n\u001b[2mFailed: \u001b[22m9\n\u001b[2mTodo: \u001b[22m3\n\x1b[0m' +); diff --git a/templates/after.js b/templates/after.js index 5d4851a9..45385b77 100644 --- a/templates/after.js +++ b/templates/after.js @@ -19,6 +19,7 @@ client.on('data', function (msg) { // Use ports for inter-process communication. app.ports.elmTestPort__send.subscribe(function (msg) { + console.log('MSG', msg); // We split incoming messages on the socket on newlines. The gist is that node // is rather unpredictable in whether or not a single `write` will result in a // single `on('data')` callback. Sometimes it does, sometimes multiple writes