-
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.
Get tests passing -- to get import.meta.glob working in the tests, we…
… need a plugin for import.meta.glob
- Loading branch information
1 parent
a1f7499
commit 1b9af89
Showing
8 changed files
with
74 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { createConfig, entityName } from './create-config.js'; |
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,32 @@ | ||
//import { createConfig } from 'ember-mirage'; | ||
//import defaultRoutes from '../routes/default'; | ||
// | ||
//export async function config(store) { | ||
// const { importEmberDataModels, importEmberDataSerializers } = await import( | ||
// 'ember-mirage/ember-data' | ||
// ); | ||
// | ||
// const mirageConfig = await createConfig({ | ||
// factories: import.meta.glob('./factories/*'), | ||
// fixtures: import.meta.glob('./fixtures/*'), | ||
// // Don't import our mirage things that will be auto-discovered | ||
// // models: import.meta.glob('./models/*'), | ||
// // serializers: import.meta.glob('./serializers/*'), | ||
// identityManagers: import.meta.glob('./identity-managers/*'), | ||
// }); | ||
// | ||
// return { | ||
// ...mirageConfig, | ||
// models: { | ||
// // use ember-data model auto discovery | ||
// ...importEmberDataModels(store, import.meta.glob('../models/*')), | ||
// ...mirageConfig.models, | ||
// }, | ||
// // apply ember-data serializer config details to mirage serializers | ||
// serializers: importEmberDataSerializers(store, mirageConfig.serializers), | ||
// routes() { | ||
// this.config({ routes: defaultRoutes }); | ||
// }, | ||
// }; | ||
//} | ||
// |
Empty file.
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,10 +1,11 @@ | ||
import mirageConfig from 'test-app/mirage/servers/default'; | ||
import mirageConfig from 'test-app/mirage/servers/manual'; | ||
|
||
import { setupMirage as _setupMirage } from 'ember-mirage/test-support'; | ||
|
||
export function setupMirage(hooks, options) { | ||
options = options || {}; | ||
options.makeServer = options.makeServer || mirageConfig; | ||
import { createServer as _createServer } from 'miragejs'; | ||
|
||
return _setupMirage(hooks, options); | ||
export function setupMirage(hooks, { createServer, config } = {}) { | ||
createServer ??= _createServer; | ||
config ??= mirageConfig; | ||
return _setupMirage(hooks, { createServer, config }); | ||
} |