Skip to content

Commit

Permalink
typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Buldauskas committed Nov 28, 2023
1 parent 3b1026e commit 39e56dd
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 9 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Unit tests
uses: actions/setup-node@v3
with:
node-version: 16.x.x
node-version: 18.x.x
- run: yarn
- run: yarn test
- name: cypress
Expand All @@ -38,17 +38,27 @@ jobs:
- name: Lints
uses: actions/setup-node@v3
with:
node-version: 16.x.x
node-version: 18.x.x
- run: yarn
- run: yarn lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Type Check
uses: actions/setup-node@v3
with:
node-version: 18.x.x
- run: yarn
- run: yarn typecheck
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lints
uses: actions/setup-node@v3
with:
node-version: 16.x.x
node-version: 18.x.x
- run: yarn
- run: yarn build

1 change: 1 addition & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import fetch from 'node-fetch';
import { defineConfig } from 'cypress';
import webpackConfig from './webpack.config.js';
Expand Down
1 change: 1 addition & 0 deletions jambox.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
/**
* This config is used for integration tests
*
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build": "webpack",
"dev": "nodemon --watch ext --watch src --exec ./jam-server.mjs",
"test": "c8 -r=text -r=lcov ava",
"typecheck": "tsc",
"e2e": "c8 -o ./coverage-cypress -r=text -r=lcov node ./e2e-backend.mjs",
"e2e-dev": "nodemon --watch ext --watch src --exec ./e2e-backend.mjs",
"cy": "HTTP_PROXY=http://localhost:8000 cypress open --component",
Expand Down
12 changes: 9 additions & 3 deletions src/Config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,23 @@ export default class Config extends Emitter {
logLocation = '';
errors = [];
/**
* @member {ProxyConfig}
* @type {import('./index.js').ProxyInfo}
*/
proxy;
noProxy = ['<-loopback->'];
trust = new Set();
/**
* @type {Record<string, import('./index.js').ForwardOption>}
*/
forward = null;
/**
* @member {object|null}
* @type {import('./index.js').CacheOption}
*/
cache;
stub = null;
/**
* @type {Record<string, import('./index.js').StubOption>}
*/
stub;
blockNetworkRequests = false;
paused = false;
/**
Expand Down
2 changes: 1 addition & 1 deletion src/Jambox.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default class Jambox extends Emitter {
}

/**
* @param {import('./index.js').StubOption} stubs
* @param {Record<string, import('./index.js').StubOption>} stubs
*/
stub(stubs) {
return Promise.all(
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["src/**/*", "cypress.config.js", "jambox.config.js"],
"include": ["src/**/*"],
"exclude": ["src/**/__tests__/*", "src/**/__mocks__/*"],
"compilerOptions": {
"target": "ES2022",
Expand All @@ -12,7 +12,8 @@
"outDir": "dist",
"declarationMap": true,
"moduleResolution": "NodeNext",
"sourceMap": false
"sourceMap": false,
"skipLibCheck": true
},
"typeAcquisition": {
"enable": true,
Expand Down

0 comments on commit 39e56dd

Please sign in to comment.