-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: test fixes, semantic release, renovate config
- Loading branch information
1 parent
fc51494
commit 52cc5d1
Showing
10 changed files
with
3,459 additions
and
102 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
language: node_js | ||
node_js: -'stable' | ||
node_js: stable | ||
yarn: true |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import JSON from '../../index'; | ||
import * as JSON from '../../index'; | ||
let o: JSON.Object = [{ foo: 'bar' }]; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import JSON from '../../index'; | ||
import * as JSON from '../../index'; | ||
let o: JSON.Value = { | ||
b: { | ||
c: { | ||
|
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import JSON from '../../index'; | ||
import * as JSON from '../../index'; | ||
let o: JSON.Arr = { foo: 'bar' }; |
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 |
---|---|---|
@@ -1,39 +1,47 @@ | ||
import { assert } from 'chai'; | ||
import { check } from 'typings-tester'; | ||
import { join, dirname } from 'path'; | ||
import { dirname } from 'path'; | ||
import * as tsconfig from 'tsconfig'; | ||
export async function assertTsThrows(fileName: string, message?: string): Promise<void>; | ||
export async function assertTsThrows(fileName: string, errType: RegExp|Function, message?: string): Promise<void>; | ||
export async function assertTsThrows(fileName: string, errType: Function, regExp: RegExp): Promise<void>; | ||
export async function assertTsThrows( | ||
fileName: string, | ||
errType?: string | RegExp | Function, | ||
message?: string | RegExp | ||
message?: string | ||
): Promise<void>; | ||
export async function assertTsThrows( | ||
fileName: string, | ||
errType: RegExp | Function, | ||
message?: string | ||
): Promise<void>; | ||
export async function assertTsThrows( | ||
fileName: string, | ||
errType: Function, | ||
regExp: RegExp | ||
): Promise<void>; | ||
export async function assertTsThrows( | ||
fileName: string, | ||
errType?: string | RegExp | Function, | ||
message?: string | RegExp | ||
): Promise<void> { | ||
return tsFileAssert(fileName, errType, message, assert.throws); | ||
return tsFileAssert(fileName, errType, message, assert.throws); | ||
} | ||
async function tsFileAssert( | ||
fileName: string, | ||
errType?: string | RegExp | Function, | ||
message?: string | RegExp, | ||
assertMethod = assert.throws | ||
errType?: string | RegExp | Function, | ||
message?: string | RegExp, | ||
assertMethod = assert.throws | ||
): Promise<void> { | ||
let typescriptConfig = await tsconfig.resolve(dirname(fileName)); | ||
let cb = () => { | ||
check( | ||
[fileName], | ||
typescriptConfig as string | ||
); | ||
}; | ||
if (!errType) { | ||
assertMethod(cb); | ||
} else if (typeof errType === 'string') { | ||
assertMethod(cb, errType); | ||
} else if (message && typeof message === 'string') { | ||
assertMethod(cb, errType, message); | ||
} else if (errType instanceof Function && message instanceof RegExp) { | ||
assertMethod(cb, errType, message); | ||
} else { | ||
assertMethod(cb, errType); | ||
} | ||
let typescriptConfig = await tsconfig.resolve(dirname(fileName)); | ||
let cb = () => { | ||
check([fileName], typescriptConfig as string); | ||
}; | ||
if (!errType) { | ||
assertMethod(cb); | ||
} else if (typeof errType === 'string') { | ||
assertMethod(cb, errType); | ||
} else if (message && typeof message === 'string') { | ||
assertMethod(cb, errType, message); | ||
} else if (errType instanceof Function && message instanceof RegExp) { | ||
assertMethod(cb, errType, message); | ||
} else { | ||
assertMethod(cb, errType); | ||
} | ||
} |
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
Oops, something went wrong.