BVB Source Codes

angular-starter Show spec-bundle.js Source code

Return Download angular-starter: download spec-bundle.js Source code - Download angular-starter Source code - Type:.js
  1. /**
  2.  * @author: @AngularClass
  3.  */
  4.  
  5. /**
  6.  * When testing with webpack and ES6, we have to do some extra
  7.  * things to get testing to work right. Because we are gonna write tests
  8.  * in ES6 too, we have to compile those as well. That's handled in
  9.  * karma.conf.js with the karma-webpack plugin. This is the entry
  10.  * file for webpack test. Just like webpack will create a bundle.js
  11.  * file for our client, when we run test, it will compile and bundle them
  12.  * all here! Crazy huh. So we need to do some setup
  13.  */
  14. Error.stackTraceLimit = Infinity;
  15.  
  16. require('core-js/es6');
  17. require('core-js/es7/reflect');
  18.  
  19. require('zone.js/dist/zone');
  20. require('zone.js/dist/long-stack-trace-zone');
  21. require('zone.js/dist/proxy'); // since zone.js 0.6.15
  22. require('zone.js/dist/sync-test');
  23. require('zone.js/dist/jasmine-patch'); // put here since zone.js 0.6.14
  24. require('zone.js/dist/async-test');
  25. require('zone.js/dist/fake-async-test');
  26.  
  27. /**
  28.  * RxJS
  29.  */
  30. require('rxjs/Rx');
  31.  
  32. var testing = require('@angular/core/testing');
  33. var browser = require('@angular/platform-browser-dynamic/testing');
  34.  
  35. testing.TestBed.initTestEnvironment(
  36.   browser.BrowserDynamicTestingModule,
  37.   browser.platformBrowserDynamicTesting()
  38. );
  39.  
  40. /**
  41.  * Ok, this is kinda crazy. We can use the context method on
  42.  * require that webpack created in order to tell webpack
  43.  * what files we actually want to require or import.
  44.  * Below, context will be a function/object with file names as keys.
  45.  * Using that regex we are saying look in ../src then find
  46.  * any file that ends with spec.ts and get its path. By passing in true
  47.  * we say do this recursively
  48.  */
  49. var testContext = require.context('../src', true, /\.spec\.ts/);
  50.  
  51. /**
  52.  * Get all the files, for each file, call the context function
  53.  * that will require the file and load it up here. Context will
  54.  * loop and require those spec files here
  55.  */
  56. function requireAll(requireContext) {
  57.   return requireContext.keys().map(requireContext);
  58. }
  59.  
  60. /**
  61.  * Requires and returns all modules that match
  62.  */
  63. var modules = requireAll(testContext);
  64.  
downloadspec-bundle.js Source code - Download angular-starter Source code
Related Source Codes/Software:
django-rest-framework - Web APIs for Django. http:/... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
angular-starter - 2017-06-10

 Back to top