-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from CRBroughton/1-create-isarray-and-isnotarray
1 create isarray and isnotarray
- Loading branch information
Showing
7 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@crbroughton/ts-test-utils": minor | ||
--- | ||
|
||
Add the isArray and isNonArray - Checks if a type is either an array or not an array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Bun Tests | ||
|
||
env: | ||
VERSION: v1.10.2 | ||
|
||
on: | ||
push: | ||
branches: [develop, master] | ||
pull_request: | ||
branches: [develop, master] | ||
jobs: | ||
bun_test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
- name: Install dependencies | ||
run: bun install | ||
- name: Run unit tests | ||
run: bun test | ||
- name: Run typechecker | ||
run: bun run typecheck | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: bun-report | ||
path: bun-report/ | ||
retention-days: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable unused-imports/no-unused-vars */ | ||
import { describe, it } from 'bun:test' | ||
import type { Expect, isArray } from '../index' | ||
|
||
describe('isArray tests', () => { | ||
it('Passes the isArray test when the type is an array', () => { | ||
type Result = Expect<isArray<{ id: number }[]>> | ||
// ^? | ||
}) | ||
it('Failed the isArray test when the type is not an array', () => { | ||
// @ts-expect-error - Fails the exclusion | ||
type Result = Expect<isArray<{ id: string }>> | ||
// ^? | ||
}) | ||
}) |