diff --git a/.github/workflows/test-badge.yml b/.github/workflows/test-badge.yml new file mode 100644 index 0000000..e2a3629 --- /dev/null +++ b/.github/workflows/test-badge.yml @@ -0,0 +1,24 @@ +name: Test Badge + +permissions: + contents: write + +on: + push: + branches: + - dev + - master + - feature/use-github-actions + +jobs: + build-and-test: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + steps: + - name: Run dotnet ci action + uses: eanzhao/frontend-ci@v0.0.10 + with: + commit-token: ${{ secrets.COMMIT_TOKEN }} + branch-name: "feature/badge" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fc2e1f..1031555 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,3 +23,4 @@ jobs: uses: greatwizard/coverage-diff-action@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.gitignore b/.gitignore index caac1a1..8888e30 100644 --- a/.gitignore +++ b/.gitignore @@ -153,3 +153,4 @@ $RECYCLE.BIN/ .idea/ package-lock.json +jest-report.xml diff --git a/README.md b/README.md index af24d0c..0bd173c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Commitizen friendly + TESTS

## Descriptions diff --git a/feature-badge-test-results.json b/feature-badge-test-results.json new file mode 100644 index 0000000..bf01a97 --- /dev/null +++ b/feature-badge-test-results.json @@ -0,0 +1 @@ +{"schemaVersion":1,"label":"tests","message":"186 tests, 0 failures, 0 errors","color":"brightgreen"} \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 53e59ea..58bb7d5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -92,7 +92,16 @@ export default { // projects: null, // Use this configuration option to add custom reporters to Jest - // reporters: undefined, + reporters: [ + 'default', + [ + 'jest-junit', + { + outputDirectory: '.', + outputName: 'jest-report.xml' + } + ] + ], // Automatically reset mock state between every test // resetMocks: false, diff --git a/package.json b/package.json index f47881c..cbebff3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aelf-command", - "version": "0.1.47-beta.6", + "version": "0.1.47-beta.7", "description": "A CLI tools for AElf", "main": "src/index.js", "type": "module", @@ -92,11 +92,12 @@ "git-cz": "^4.9.0", "husky": "^9.0.11", "jest": "^29.7.0", + "jest-junit": "^16.0.0", "lint-staged": "^15.2.5", "prettier": "^3.3.2", + "socket.io-client": "^4.7.5", "standard-version": "^9.5.0", - "typescript": "^5.5.2", - "socket.io-client": "^4.7.5" + "typescript": "^5.5.2" }, "keywords": [ "AElf", diff --git a/yarn.lock b/yarn.lock index b0f0fa0..142e902 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5029,6 +5029,16 @@ jest-haste-map@^29.7.0: optionalDependencies: fsevents "^2.3.2" +jest-junit@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-16.0.0.tgz#d838e8c561cf9fdd7eb54f63020777eee4136785" + integrity sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ== + dependencies: + mkdirp "^1.0.4" + strip-ansi "^6.0.1" + uuid "^8.3.2" + xml "^1.0.1" + jest-leak-detector@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz#5b7ec0dadfdfec0ca383dc9aa016d36b5ea4c728" @@ -5750,6 +5760,11 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.8: resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + mkdirp@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" @@ -7404,6 +7419,11 @@ util@^0.12.5: is-typed-array "^1.1.3" which-typed-array "^1.1.2" +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + uuid@^9.0.1: version "9.0.1" resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" @@ -7567,6 +7587,11 @@ xdg-basedir@^5.0.1, xdg-basedir@^5.1.0: resolved "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz#1efba19425e73be1bc6f2a6ceb52a3d2c884c0c9" integrity sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ== +xml@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== + xmlhttprequest-ssl@~2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67"