Skip to content

Commit

Permalink
Fix/npm test (#139)
Browse files Browse the repository at this point in the history
* Remove "npm run useChrome" directive from the test script.

* Add typescript typechecking to the test script

* Add missing run keyword
  • Loading branch information
A-K-O-R-A authored Jan 24, 2024
1 parent 755db8b commit 5bea269
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ name: Test and Build
on:
push:
branches:
- main
- develop
- main
- develop
pull_request:
branches:
- main
- develop
- main
- develop
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
- run: npm ci
- run: npm run test
- uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: "16.x"
cache: "npm"
# Install dependencies
- run: npm ci
# Use chrome manifest
- run: npm run useChrome
# Run tests
- run: npm run test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"lint": "npx eslint --ext .js,.ts,.vue --fix .",
"test": "npm run lint && npm run useChrome && npm run build",
"ts-check": "npx tsc --noEmit",
"test": "npm run ts-check && npm run lint && npm run build",
"dev": "snowpack build --watch",
"build": "snowpack build",
"useChrome": "cp src/manifest.chrome.json src/manifest.json",
Expand Down
4 changes: 4 additions & 0 deletions src/contentScripts/other/hisqis/newTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ import { DataTable } from 'simple-datatables'

oldTable.parentNode?.insertBefore(newTable, oldTable)

// If "TS2578: Unused '@ts-expect-error' directive" appears then they probably fixxed their typescript
// definition and the following @ts-expect-error directive should be removed.
// See: https://fiduswriter.github.io/simple-datatables/documentation/Getting-Started#browser
// @ts-expect-error
// eslint-disable-next-line no-unused-vars
const _dataTable = new DataTable(newTable, {
sortable: true,
Expand Down

0 comments on commit 5bea269

Please sign in to comment.