Skip to content

Commit

Permalink
test: refactor logger test to async
Browse files Browse the repository at this point in the history
  • Loading branch information
climba03003 committed Apr 25, 2023
1 parent 82c1554 commit a61a376
Show file tree
Hide file tree
Showing 7 changed files with 1,781 additions and 1,827 deletions.
208 changes: 104 additions & 104 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,56 @@ concurrency:
cancel-in-progress: true

jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@v3

linter:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install
run: |
npm install --ignore-scripts
- name: Lint code
run: |
npm run lint
coverage-nix:
needs: linter
permissions:
contents: read
uses: ./.github/workflows/coverage-nix.yml
coverage-win:
needs: linter
permissions:
contents: read
uses: ./.github/workflows/coverage-win.yml
# dependency-review:
# name: Dependency Review
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - name: Check out repo
# uses: actions/checkout@v3
# with:
# persist-credentials: false

# - name: Dependency review
# uses: actions/dependency-review-action@v3

# linter:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false

# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 'lts/*'

# - name: Install
# run: |
# npm install --ignore-scripts

# - name: Lint code
# run: |
# npm run lint

# coverage-nix:
# needs: linter
# permissions:
# contents: read
# uses: ./.github/workflows/coverage-nix.yml
# coverage-win:
# needs: linter
# permissions:
# contents: read
# uses: ./.github/workflows/coverage-win.yml

test:
needs: [linter, coverage-nix, coverage-win]
# needs: [linter, coverage-nix, coverage-win]
runs-on: ${{ matrix.os }}
permissions:
contents: read
Expand All @@ -85,13 +85,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
# - uses: actions/cache@v3
# id: check-cache
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
# restore-keys: |
# ${{ runner.os }}-node-${{ matrix.node-version }}-

- name: Install
run: |
Expand All @@ -105,52 +105,52 @@ jobs:
run: |
npm run test:ci
automerge:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs: test
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

package:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: actions/cache@v3
id: check-cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: install fastify
run: |
npm install --ignore-scripts
- name: install webpack stack
run: |
cd test/bundler/webpack && npm install
- name: Test webpack bundle
run: |
cd test/bundler/webpack && npm run test
- name: install esbuild stack
run: |
cd test/bundler/esbuild && npm install
- name: Test esbuild bundle
run: |
cd test/bundler/esbuild && npm run test
# automerge:
# if: >
# github.event_name == 'pull_request' &&
# github.event.pull_request.user.login == 'dependabot[bot]'
# needs: test
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write
# contents: write
# steps:
# - uses: fastify/github-action-merge-dependabot@v3
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}

# package:
# needs: test
# runs-on: ubuntu-latest
# permissions:
# contents: read
# steps:
# - uses: actions/checkout@v3
# with:
# persist-credentials: false
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 'lts/*'
# - uses: actions/cache@v3
# id: check-cache
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
# - name: install fastify
# run: |
# npm install --ignore-scripts
# - name: install webpack stack
# run: |
# cd test/bundler/webpack && npm install
# - name: Test webpack bundle
# run: |
# cd test/bundler/webpack && npm run test
# - name: install esbuild stack
# run: |
# cd test/bundler/esbuild && npm install
# - name: Test esbuild bundle
# run: |
# cd test/bundler/esbuild && npm run test
1 change: 1 addition & 0 deletions .taprc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ jsx: false
flow: false
check-coverage: true
coverage: true
debug: true
node-arg: --allow-natives-syntax

files:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint:typescript": "eslint -c types/.eslintrc.json types/**/*.d.ts test/types/**/*.test-d.ts",
"prepublishOnly": "PREPUBLISH=true tap --no-check-coverage test/build/**.test.js && npm run test:validator:integrity",
"test": "npm run lint && npm run unit && npm run test:typescript",
"test:ci": "npm run unit -- -R terse --cov --coverage-report=lcovonly && npm run test:typescript",
"test:ci": "npm run unit -- --cov --coverage-report=lcovonly && npm run test:typescript",
"test:report": "npm run lint && npm run unit:report && npm run test:typescript",
"test:validator:integrity": "npm run build:validation && git diff --quiet --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol lib/error-serializer.js && git diff --quiet --ignore-all-space --ignore-blank-lines --ignore-cr-at-eol lib/configValidator.js",
"test:typescript": "tsc test/types/import.ts && tsd",
Expand Down

0 comments on commit a61a376

Please sign in to comment.