fixed karma-webpack, also added jasmine-ts to run tests in pure NodeJS
This commit is contained in:
parent
8f0f16a551
commit
8dc9cf21d7
4 changed files with 7 additions and 9 deletions
|
@ -4,7 +4,7 @@ var webpackConfig = require('./webpack.config');
|
||||||
module.exports = function(config) {
|
module.exports = function(config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
frameworks: ['jasmine', 'karma-typescript'],
|
frameworks: ['jasmine'],
|
||||||
files: [
|
files: [
|
||||||
// CDN resources
|
// CDN resources
|
||||||
'node_modules/jquery/dist/jquery.js',
|
'node_modules/jquery/dist/jquery.js',
|
||||||
|
@ -28,7 +28,7 @@ module.exports = function(config) {
|
||||||
'static/lib/**/*.js',
|
'static/lib/**/*.js',
|
||||||
|
|
||||||
// Application resources
|
// Application resources
|
||||||
'static/js/**/*.ts*',
|
'static/js/**/*.spec.ts*',
|
||||||
|
|
||||||
// Tests utils
|
// Tests utils
|
||||||
'static/test/**/*.js',
|
'static/test/**/*.js',
|
||||||
|
@ -39,7 +39,8 @@ module.exports = function(config) {
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
'static/lib/ngReact/react.ngReact.min.js': ['webpack'],
|
'static/lib/ngReact/react.ngReact.min.js': ['webpack'],
|
||||||
'static/lib/angular-moment.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: {
|
webpack: {
|
||||||
resolve: webpackConfig.resolve,
|
resolve: webpackConfig.resolve,
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "./node_modules/.bin/karma start --single-run --browsers PhantomJS",
|
"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",
|
"build": "./node_modules/.bin/webpack --progress -p -v",
|
||||||
"watch": "./node_modules/.bin/webpack --watch"
|
"watch": "./node_modules/.bin/webpack --watch"
|
||||||
},
|
},
|
||||||
|
@ -41,13 +42,13 @@
|
||||||
"angular-mocks": "^1.5.3",
|
"angular-mocks": "^1.5.3",
|
||||||
"css-loader": "0.25.0",
|
"css-loader": "0.25.0",
|
||||||
"jasmine-core": "^2.5.2",
|
"jasmine-core": "^2.5.2",
|
||||||
|
"jasmine-ts": "0.0.3",
|
||||||
"karma": "^0.13.22",
|
"karma": "^0.13.22",
|
||||||
"karma-chrome-launcher": "^2.0.0",
|
"karma-chrome-launcher": "^2.0.0",
|
||||||
"karma-coverage": "^0.5.5",
|
"karma-coverage": "^0.5.5",
|
||||||
"karma-es6-shim": "^1.0.0",
|
"karma-es6-shim": "^1.0.0",
|
||||||
"karma-jasmine": "^0.3.8",
|
"karma-jasmine": "^0.3.8",
|
||||||
"karma-phantomjs-launcher": "^1.0.0",
|
"karma-phantomjs-launcher": "^1.0.0",
|
||||||
"karma-typescript": "^2.1.6",
|
|
||||||
"karma-webpack": "^1.8.1",
|
"karma-webpack": "^1.8.1",
|
||||||
"node-sass": "3.10.1",
|
"node-sass": "3.10.1",
|
||||||
"phantomjs-prebuilt": "^2.1.7",
|
"phantomjs-prebuilt": "^2.1.7",
|
||||||
|
|
|
@ -35,7 +35,7 @@ export class RouteBuilderImpl implements RouteBuilder {
|
||||||
var page = pair[1];
|
var page = pair[1];
|
||||||
var templateUrl = foundProfile.templatePath + page.templateName;
|
var templateUrl = foundProfile.templatePath + page.templateName;
|
||||||
|
|
||||||
var options = jQuery.extend({}, page.flags || {});
|
var options = page.flags || {};
|
||||||
options['templateUrl'] = templateUrl;
|
options['templateUrl'] = templateUrl;
|
||||||
options['reloadOnSearch'] = false;
|
options['reloadOnSearch'] = false;
|
||||||
options['controller'] = page.controller;
|
options['controller'] = page.controller;
|
||||||
|
|
|
@ -7,10 +7,6 @@ describe("Service: RouteBuilderImpl", () => {
|
||||||
var profiles;
|
var profiles;
|
||||||
var currentProfile;
|
var currentProfile;
|
||||||
|
|
||||||
it("sanity", () => {
|
|
||||||
expect(true).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach((() => {
|
beforeEach((() => {
|
||||||
profiles = [
|
profiles = [
|
||||||
{id: 'old-layout', templatePath: '/static/partials/'},
|
{id: 'old-layout', templatePath: '/static/partials/'},
|
||||||
|
|
Reference in a new issue