This repository has been archived by the owner on Oct 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/pawelgalazka/runjs
- Loading branch information
Showing
20 changed files
with
1,792 additions
and
1,864 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
} |
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,3 @@ | ||
{ | ||
"semi": false | ||
} |
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 @@ | ||
language: node_js | ||
node_js: | ||
- "8.10.0" | ||
- "9.8.0" | ||
- "8.15.0" | ||
- "10.15.0" |
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,56 @@ | ||
// For a detailed explanation regarding each configuration property, visit: | ||
// https://jestjs.io/docs/en/configuration.html | ||
|
||
module.exports = { | ||
// Indicates whether the coverage information should be collected while executing the test | ||
// collectCoverage: false, | ||
|
||
// An array of glob patterns indicating a set of files for which coverage information should be collected | ||
collectCoverageFrom: [ | ||
"<rootDir>/**/*.ts" | ||
], | ||
|
||
// A list of reporter names that Jest uses when writing coverage reports | ||
coverageReporters: [ | ||
"text", | ||
"text-summary" | ||
], | ||
|
||
// An object that configures minimum threshold enforcement for coverage results | ||
coverageThreshold: { | ||
"global": { | ||
"lines": 50 | ||
} | ||
}, | ||
|
||
// A set of global variables that need to be available in all test environments | ||
globals: { | ||
"ts-jest": { | ||
"tsConfig": "tsconfig.json" | ||
} | ||
}, | ||
|
||
// An array of file extensions your modules use | ||
moduleFileExtensions: [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx" | ||
], | ||
|
||
// The root directory that Jest should scan for tests and modules within | ||
rootDir: "./test", | ||
|
||
// The test environment that will be used for testing | ||
testEnvironment: "node", | ||
|
||
// The glob patterns Jest uses to detect test files | ||
testMatch: [ | ||
"**/*.spec.(ts|tsx)" | ||
], | ||
|
||
// A map from regular expressions to paths to transformers | ||
transform: { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
} | ||
}; |
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,41 +1,40 @@ | ||
// @flow | ||
import chalk from 'chalk' | ||
import chalk from "chalk" | ||
|
||
// Needed to use ES5 inheritance, because of issues with Error subclassing for Babel | ||
export class RunJSError extends Error { | ||
constructor(message: string) { | ||
message = message && message.split('\n')[0] // assign only first line | ||
message = message && message.split("\n")[0] // assign only first line | ||
super(message) | ||
} | ||
} | ||
|
||
export interface ILogger { | ||
title(args: Array<any>): void; | ||
log(args: Array<any>): void; | ||
warning(args: Array<any>): void; | ||
error(args: Array<any>): void; | ||
title(...args: any[]): void | ||
log(...args: any[]): void | ||
warning(...args: any[]): void | ||
error(...args: any[]): void | ||
} | ||
|
||
export class Logger implements ILogger { | ||
title(...args: Array<any>) { | ||
public title(...args: any[]) { | ||
console.log(chalk.bold(...args)) | ||
} | ||
log(...args: Array<any>) { | ||
public log(...args: any[]) { | ||
console.log(...args) | ||
} | ||
warning(...args: Array<any>) { | ||
public warning(...args: any[]) { | ||
console.warn(chalk.yellow(...args)) | ||
} | ||
error(...args: Array<any>) { | ||
public error(...args: any[]) { | ||
console.error(chalk.red(...args)) | ||
} | ||
} | ||
|
||
export class SilentLogger implements ILogger { | ||
title() {} | ||
log() {} | ||
warning() {} | ||
error() {} | ||
public title() {} | ||
public log() {} | ||
public warning() {} | ||
public error() {} | ||
} | ||
|
||
export const logger = new Logger() |
Oops, something went wrong.