fixed karma-webpack, also added jasmine-ts to run tests in pure NodeJS

This commit is contained in:
alecmerdler 2017-01-19 20:02:57 -08:00
parent 8f0f16a551
commit 8dc9cf21d7
4 changed files with 7 additions and 9 deletions

View file

@ -4,7 +4,7 @@ var webpackConfig = require('./webpack.config');
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine', 'karma-typescript'],
frameworks: ['jasmine'],
files: [
// CDN resources
'node_modules/jquery/dist/jquery.js',
@ -28,7 +28,7 @@ module.exports = function(config) {
'static/lib/**/*.js',
// Application resources
'static/js/**/*.ts*',
'static/js/**/*.spec.ts*',
// Tests utils
'static/test/**/*.js',
@ -39,7 +39,8 @@ module.exports = function(config) {
preprocessors: {
'static/lib/ngReact/react.ngReact.min.js': ['webpack'],
'static/lib/angular-moment.min.js': ['webpack'],
'static/js/**/*.ts*': ['karma-typescript'],
// 'static/js/**/*.ts*': ['karma-typescript'],
'static/js/**/*.ts*': ['webpack'],
},
webpack: {
resolve: webpackConfig.resolve,

View file

@ -5,6 +5,7 @@
"version": "1.0.0",
"scripts": {
"test": "./node_modules/.bin/karma start --single-run --browsers PhantomJS",
"test:node": "./node_modules/.bin/jasmine-ts './static/js/**/*.spec.ts'",
"build": "./node_modules/.bin/webpack --progress -p -v",
"watch": "./node_modules/.bin/webpack --watch"
},
@ -41,13 +42,13 @@
"angular-mocks": "^1.5.3",
"css-loader": "0.25.0",
"jasmine-core": "^2.5.2",
"jasmine-ts": "0.0.3",
"karma": "^0.13.22",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^0.5.5",
"karma-es6-shim": "^1.0.0",
"karma-jasmine": "^0.3.8",
"karma-phantomjs-launcher": "^1.0.0",
"karma-typescript": "^2.1.6",
"karma-webpack": "^1.8.1",
"node-sass": "3.10.1",
"phantomjs-prebuilt": "^2.1.7",

View file

@ -35,7 +35,7 @@ export class RouteBuilderImpl implements RouteBuilder {
var page = pair[1];
var templateUrl = foundProfile.templatePath + page.templateName;
var options = jQuery.extend({}, page.flags || {});
var options = page.flags || {};
options['templateUrl'] = templateUrl;
options['reloadOnSearch'] = false;
options['controller'] = page.controller;

View file

@ -7,10 +7,6 @@ describe("Service: RouteBuilderImpl", () => {
var profiles;
var currentProfile;
it("sanity", () => {
expect(true).toBe(true);
});
beforeEach((() => {
profiles = [
{id: 'old-layout', templatePath: '/static/partials/'},