-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
82 additions
and
16 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
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 |
---|---|---|
|
@@ -32,6 +32,10 @@ describe('generator:app', () => { | |
'.esdoc.json', | ||
'src/index.js', | ||
'src/index.test.js', | ||
'types/index.d.ts', | ||
'types/test.ts', | ||
'types/tsconfig.json', | ||
'types/types.test.js', | ||
]) | ||
}) | ||
describe('src/', () => { | ||
|
@@ -44,7 +48,7 @@ describe('generator:app', () => { | |
}) | ||
assert.fileContent('src/index.js', 'funTime()') | ||
}) | ||
it('generates source file based on plugin name', async () => { | ||
it('generates test file based on plugin name', async () => { | ||
await helpers.run(__dirname).withPrompts({ | ||
pluginName: 'danger-plugin-fun-time', | ||
description: 'Danger plugin that tells you to have a fun time', | ||
|
@@ -54,6 +58,28 @@ describe('generator:app', () => { | |
assert.fileContent('src/index.test.js', 'funTime()') | ||
}) | ||
}) | ||
describe('types/', () => { | ||
beforeEach(async () => { | ||
await helpers.run(__dirname).withPrompts({ | ||
pluginName: 'danger-plugin-jest-test-runner', | ||
description: 'Danger plugin that runs Jest tests', | ||
authorName: 'Macklin Underdown', | ||
authorEmail: '[email protected]', | ||
}) | ||
}) | ||
it('generates TypeScript type defintion', () => { | ||
assert.fileContent( | ||
'types/index.d.ts', | ||
'export default function jestTestRunner(): void' | ||
) | ||
}) | ||
it('generates TypeScript test file', () => { | ||
assert.fileContent( | ||
'types/test.ts', | ||
`import jestTestRunner from './'\n\njestTestRunner()` | ||
) | ||
}) | ||
}) | ||
describe('CODE_OF_CONDUCT.md', () => { | ||
it('contains author email', async () => { | ||
await helpers.run(__dirname).withPrompts({ | ||
|
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 @@ | ||
export default function <%= pluginFunctionName %> { | ||
export default function <%= pluginFunctionName %>() { | ||
|
||
} |
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 @@ | ||
describe('<%= pluginFunctionName %>', () => { | ||
describe('<%= pluginFunctionName %>()', () => { | ||
it('does something') | ||
}) |
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 @@ | ||
export default function <%= pluginFunctionName %>(): 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import <%= pluginFunctionName %> from './' | ||
|
||
<%= pluginFunctionName %>() |
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,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictNullChecks": true, | ||
"sourceMap": 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { join } from 'path' | ||
import { check } from 'typings-tester' | ||
|
||
test('TypeScript types', () => { | ||
expect(() => { | ||
check([join(__dirname, 'test.ts')], join(__dirname, 'tsconfig.json')) | ||
}).not.toThrow() | ||
}) |
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