forked from dsuket/angular2-webpack-ngc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use karma shim to avoid adding BrowserDomAdapter to spec files
- Loading branch information
Showing
5 changed files
with
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Error.stackTraceLimit = Infinity; | ||
require('es6-shim'); | ||
require('angular2/bundles/angular2-polyfills.js'); | ||
require('angular2/testing'); | ||
|
||
/* | ||
Ok, this is kinda crazy. We can use the the context method on | ||
require that webpack created in order to tell webpack | ||
what files we actually want to require or import. | ||
Below, context will be an function/object with file names as keys. | ||
using that regex we are saying look in client/app and find | ||
any file that ends with spec.js and get its path. By passing in true | ||
we say do this recursively | ||
*/ | ||
var appContext = require.context('./src', true, /\.spec\.ts/); | ||
|
||
// get all the files, for each file, call the context function | ||
// that will require the file and load it up here. Context will | ||
// loop and require those spec files here | ||
appContext.keys().forEach(appContext); | ||
|
||
|
||
// Select BrowserDomAdapter. | ||
// see https://github.com/AngularClass/angular2-webpack-starter/issues/124 | ||
var domAdapter = require('angular2/src/platform/browser/browser_adapter'); | ||
domAdapter.BrowserDomAdapter.makeCurrent(); |
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