Skip to content

Commit

Permalink
👷 Add unit tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
trickypr committed Nov 13, 2023
1 parent 6ef3b5d commit 3c119ce
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ jobs:
- name: Build
run: pnpm build

- name: Run tests
run: pnpm script:unit-test

- name: De-symlink
run: rsync .store/rt/ rt_dist/ -a --copy-links
- name: Upload artifact
Expand Down
4 changes: 4 additions & 0 deletions scripts/unit-test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { argv, exit } from 'node:process'
import { App } from '@tinyhttp/app'
import { type ExecaChildProcess, execa } from 'execa'
Expand Down
1 change: 0 additions & 1 deletion src/content/shared/types/Optional.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

4 changes: 4 additions & 0 deletions src/content/tests/manager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { hold, report, createTAPReporter } from 'zora'

const TEST_PORT = 3948
Expand Down
4 changes: 4 additions & 0 deletions src/content/tests/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import search from './search'

export default async function () {
Expand Down
4 changes: 4 additions & 0 deletions src/content/tests/shared/search/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import providers from './providers'

export default async function () {
Expand Down
4 changes: 4 additions & 0 deletions src/content/tests/shared/search/providers/URLProvider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { test } from 'zora'

import { URLProvider } from '@shared/search/providers/URLProvider'
Expand Down
4 changes: 4 additions & 0 deletions src/content/tests/shared/search/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import URLProvider from './URLProvider'

export default async function () {
Expand Down
4 changes: 4 additions & 0 deletions src/content/tests/tests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { test } from 'zora'
import { manageTests } from './manager'

Expand Down
15 changes: 4 additions & 11 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
"target": "es2022",
"allowArbitraryExtensions": true,
"paths": {
"@shared/*": [
"./src/content/shared/*"
]
"@shared/*": ["./src/content/shared/*"]
}
},
"include": [
"src/content/**/*"
],
"exclude": [
"node_modules/*",
"public/*"
]
}
"include": ["src/content/**/*"],
"exclude": ["node_modules/*", "public/*"]
}

0 comments on commit 3c119ce

Please sign in to comment.