-
Notifications
You must be signed in to change notification settings - Fork 439
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 #2366 from dfreeman/type-declarations
Add TS declaration for `setupMirage`
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
interface TestHooks { | ||
beforeEach(callback: () => void): void; | ||
afterEach(callback: () => void): void; | ||
} | ||
|
||
/** | ||
* Starts the Mirage server and makes it available under | ||
* `this.server` for any tests run within this context, | ||
* shutting it down afterwards. | ||
*/ | ||
export function setupMirage(hooks?: TestHooks): 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,10 @@ | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
import { module } from 'qunit'; | ||
|
||
// Mocha-style usage | ||
setupMirage(); | ||
|
||
// QUnit-style usage | ||
module('A Mirage test', (hooks) => { | ||
setupMirage(hooks); | ||
}); |
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": { | ||
"strict": true, | ||
"noEmit": true, | ||
"baseUrl": "..", | ||
"paths": { | ||
"ember-cli-mirage/*": ["./*"] | ||
} | ||
} | ||
} |
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