From e55608c34b1f67d0366eaa3e9b00618f07914cc8 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 14 Sep 2021 02:49:18 -0500 Subject: [PATCH] test: add tests --- .github/workflows/CI.yml | 43 +++---------------------------- package.json | 12 +++++---- pnpm-lock.yaml | 55 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 45 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 69b6e3f3..98e1ef94 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -48,43 +48,6 @@ jobs: run: | pnpm install - Lint: - if: "!contains(github.event.head_commit.message, '[skip ci]')" - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Commit lint ✨ - uses: wagoid/commitlint-github-action@v2 - - - name: Cache - uses: actions/cache@v2 - with: - path: | - ~/.pnpm-store - D:\.pnpm-store - key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}" - restore-keys: | - "setupcpp-cache-OS:${{ matrix.os }}" - - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - - name: Setup Pnpm - uses: pnpm/action-setup@v2 - with: - version: ${{ matrix.pnpm }} - - - name: Install dependencies - run: pnpm install - - - name: Format ✨ - run: pnpm run test.format - - - name: Lint ✨ - run: pnpm run test.lint + - name: Test + run: | + pnpm test diff --git a/package.json b/package.json index 08b251d7..472748f2 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,15 @@ "license": "Apache-2.0", "scripts": { "format": "prettier --write .", - "test.format": "prettier . --check", "lint": "eslint . --fix", - "test.lint": "eslint .", "clean": "shx rm -rf dist", - "test.tsc": "tsc -p src/tsconfig.json --noEmit", "dev": "cross-env NODE_ENV=development parcel watch", "build": "cross-env NODE_ENV=production parcel build --detailed-report", - "prepare": "npm run build" + "prepare": "npm run build", + "test.format": "prettier . --check", + "test.lint": "eslint .", + "test.tsc": "tsc -p src/tsconfig.json --noEmit", + "test": "run-p test.format test.lint test.tsc" }, "engines": { "node": ">=12.x" @@ -42,7 +43,8 @@ "semver": "^7.3.5", "shx": "0.3.3", "terser-config-atomic": "^0.1.1", - "typescript": "^4.4.3" + "typescript": "^4.4.3", + "npm-run-all2": "^5.0.2" }, "keywords": [ "github-actions", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00fb7d3f..56afa5ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,7 @@ importers: cross-env: 7.0.3 eslint-config-atomic: ^1.16.2 hasha: ^5.2.2 + npm-run-all2: ^5.0.2 parcel: ^2.0.0-rc.0 prettier-config-atomic: ^2.0.5 semver: ^7.3.5 @@ -25,6 +26,7 @@ importers: cross-env: 7.0.3 eslint-config-atomic: 1.16.2 hasha: 5.2.2 + npm-run-all2: 5.0.2 parcel: 2.0.0-rc.0 prettier-config-atomic: 2.0.5 semver: 7.3.5 @@ -1104,6 +1106,10 @@ packages: resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==} dev: true + /@types/normalize-package-data/2.4.1: + resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + dev: true + /@types/parse-json/4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} dev: true @@ -1323,6 +1329,11 @@ packages: color-convert: 2.0.1 dev: true + /ansi-styles/5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -4361,6 +4372,11 @@ packages: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} dev: true + /memorystream/0.3.1: + resolution: {integrity: sha1-htcJCzDORV1j+64S3aUaR93K+bI=} + engines: {node: '>= 0.10.0'} + dev: true + /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -4579,6 +4595,20 @@ packages: engines: {node: '>=10'} dev: true + /npm-run-all2/5.0.2: + resolution: {integrity: sha512-S2G6FWZ3pNWAAKm2PFSOtEAG/N+XO/kz3+9l6V91IY+Y3XFSt7Lp7DV92KCgEboEW0hRTu0vFaMe4zXDZYaOyA==} + engines: {node: '>= 10'} + hasBin: true + dependencies: + ansi-styles: 5.2.0 + cross-spawn: 7.0.3 + memorystream: 0.3.1 + minimatch: 3.0.4 + pidtree: 0.5.0 + read-pkg: 5.2.0 + shell-quote: 1.7.2 + dev: true + /nth-check/2.0.0: resolution: {integrity: sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==} dependencies: @@ -4932,6 +4962,12 @@ packages: engines: {node: '>=8.6'} dev: true + /pidtree/0.5.0: + resolution: {integrity: sha512-9nxspIM7OpZuhBxPg73Zvyq7j1QMPMPsGKTqRc2XOaFQauDvoNz9fM1Wdkjmeo7l9GXOZiRs97sPkuayl39wjA==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + /pify/3.0.0: resolution: {integrity: sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=} engines: {node: '>=4'} @@ -5580,6 +5616,16 @@ packages: path-type: 3.0.0 dev: true + /read-pkg/5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + dependencies: + '@types/normalize-package-data': 2.4.1 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + dev: true + /readable-stream/1.1.14: resolution: {integrity: sha1-fPTFTvZI44EwhMY23SB54WbAgdk=} dependencies: @@ -5889,6 +5935,10 @@ packages: engines: {node: '>=8'} dev: true + /shell-quote/1.7.2: + resolution: {integrity: sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==} + dev: true + /shelljs/0.3.0: resolution: {integrity: sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=} engines: {node: '>=0.8.0'} @@ -6413,6 +6463,11 @@ packages: engines: {node: '>=10'} dev: true + /type-fest/0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + dev: true + /type-fest/0.8.1: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'}