Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from prettier to dprint for formatting
- Loading branch information
1 parent
b9c9e2b
commit 2a6ef64
Showing
16 changed files
with
113 additions
and
94 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,16 +1,16 @@ | ||
{ | ||
"plugins": ["jest", "@typescript-eslint"], | ||
"extends": ["plugin:github/es6"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 9, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": {}, | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": true | ||
} | ||
"plugins": ["jest", "@typescript-eslint"], | ||
"extends": ["plugin:github/es6"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 9, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": {}, | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"jest/globals": 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 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
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,78 +1,78 @@ | ||
import { morph } from "mock-env"; | ||
import { getInputs } from "../src/getInputs"; | ||
import { morph } from 'mock-env'; | ||
import { getInputs } from '../src/getInputs'; | ||
|
||
const MANDATORY_INPUTS = { | ||
INPUT_HEAD: "refs/heads/feature/test", | ||
INPUT_TITLE: "My test pull request", | ||
GITHUB_REPOSITORY: "foo/bar" | ||
INPUT_HEAD: 'refs/heads/feature/test', | ||
INPUT_TITLE: 'My test pull request', | ||
GITHUB_REPOSITORY: 'foo/bar', | ||
}; | ||
|
||
it("should default base to master", function() { | ||
it('should default base to master', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS | ||
...MANDATORY_INPUTS, | ||
}); | ||
|
||
expect(inputs).toHaveProperty("base", "master"); | ||
expect(inputs).toHaveProperty('base', 'master'); | ||
}); | ||
|
||
it('should parse "false" for draft as false', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS, | ||
INPUT_DRAFT: "false" | ||
INPUT_DRAFT: 'false', | ||
}); | ||
|
||
expect(inputs).toHaveProperty("draft", false); | ||
expect(inputs).toHaveProperty('draft', false); | ||
}); | ||
|
||
it('should parse "true" for draft as true', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS, | ||
INPUT_DRAFT: "true" | ||
INPUT_DRAFT: 'true', | ||
}); | ||
|
||
expect(inputs).toHaveProperty("draft", true); | ||
expect(inputs).toHaveProperty('draft', true); | ||
}); | ||
|
||
it("should include body if given", function() { | ||
it('should include body if given', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS, | ||
INPUT_BODY: "Fixes #42" | ||
INPUT_BODY: 'Fixes #42', | ||
}); | ||
|
||
expect(inputs).toHaveProperty("body", "Fixes #42"); | ||
expect(inputs).toHaveProperty('body', 'Fixes #42'); | ||
}); | ||
|
||
it("should parse owner and repo", function() { | ||
it('should parse owner and repo', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS | ||
...MANDATORY_INPUTS, | ||
}); | ||
|
||
expect(inputs).toHaveProperty("owner", "foo"); | ||
expect(inputs).toHaveProperty("repo", "bar"); | ||
expect(inputs).toHaveProperty('owner', 'foo'); | ||
expect(inputs).toHaveProperty('repo', 'bar'); | ||
}); | ||
|
||
it("should default to empty list of reviewers", function() { | ||
it('should default to empty list of reviewers', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS | ||
...MANDATORY_INPUTS, | ||
}); | ||
|
||
expect(inputs).toHaveProperty("reviewers", []); | ||
expect(inputs).toHaveProperty('reviewers', []); | ||
}); | ||
|
||
it("should split reviewers by comma", function() { | ||
it('should split reviewers by comma', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS, | ||
INPUT_REVIEWERS: "thomaseizinger,bonomat" | ||
INPUT_REVIEWERS: 'thomaseizinger,bonomat', | ||
}); | ||
|
||
expect(inputs).toHaveProperty("reviewers", ["thomaseizinger", "bonomat"]); | ||
expect(inputs).toHaveProperty('reviewers', ['thomaseizinger', 'bonomat']); | ||
}); | ||
|
||
it("should trim reviewer names", function() { | ||
it('should trim reviewer names', function() { | ||
const inputs = morph(getInputs, { | ||
...MANDATORY_INPUTS, | ||
INPUT_REVIEWERS: "d4nte, bonomat, luckysori" | ||
INPUT_REVIEWERS: 'd4nte, bonomat, luckysori', | ||
}); | ||
|
||
expect(inputs).toHaveProperty("reviewers", ["d4nte", "bonomat", "luckysori"]); | ||
expect(inputs).toHaveProperty('reviewers', ['d4nte', 'bonomat', 'luckysori']); | ||
}); |
Large diffs are not rendered by default.
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,23 @@ | ||
{ | ||
"$schema": "https://dprint.dev/schemas/v0.json", | ||
"incremental": true, | ||
"typescript": { | ||
"quoteStyle": "preferSingle", | ||
"indentWidth": 2 | ||
}, | ||
"json": { | ||
}, | ||
"markdown": { | ||
}, | ||
"includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md}"], | ||
"excludes": [ | ||
"**/node_modules", | ||
"**/*-lock.json", | ||
"dist/**" | ||
], | ||
"plugins": [ | ||
"https://plugins.dprint.dev/typescript-0.46.0.wasm", | ||
"https://plugins.dprint.dev/json-0.12.0.wasm", | ||
"https://plugins.dprint.dev/markdown-0.8.0.wasm" | ||
] | ||
} |
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
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 @@ | ||
declare module "mock-env" { | ||
declare module 'mock-env' { | ||
function morph<T>(callback: () => T, vars: object, toRemove?: string[]): void; | ||
} |
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