From bee504d0bae282183f6eafb46b3048f9a139702f Mon Sep 17 00:00:00 2001 From: alecmerdler Date: Thu, 19 Jan 2017 02:10:00 -0800 Subject: [PATCH] switched to running tests using karma-typescript --- karma.conf.js | 12 ++++-------- package.json | 3 ++- static/js/quay.module.ts | 2 +- static/js/route-builder/route-builder.spec.js | 2 +- tsconfig.json | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index d0c92772a..1f3af9aa6 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -4,7 +4,7 @@ var webpackConfig = require('./webpack.config'); module.exports = function(config) { config.set({ basePath: '', - frameworks: ['jasmine'], + frameworks: ['jasmine', 'karma-typescript'], files: [ // CDN resources 'node_modules/jquery/dist/jquery.js', @@ -28,13 +28,10 @@ module.exports = function(config) { 'static/lib/**/*.js', // Application resources - 'static/js/quay.module.ts', - // 'static/js/**/*.js', + 'static/js/**/*.ts', // Tests 'static/test/**/*.js', - 'static/js/**/*.spec.js', - 'static/js/**/*.spec.ts', ], exclude: [ 'static/js/build/bundle.js', @@ -42,8 +39,7 @@ module.exports = function(config) { preprocessors: { 'static/lib/ngReact/react.ngReact.min.js': ['webpack'], 'static/lib/angular-moment.min.js': ['webpack'], - 'static/js/quay.module.ts': ['webpack'], - 'static/js/**/*.spec.ts': ['webpack'], + 'static/js/**/*.ts': ['karma-typescript'], }, webpack: { resolve: webpackConfig.resolve, @@ -66,7 +62,7 @@ module.exports = function(config) { webpackMiddleware: { stats: 'errors-only' }, - reporters: ['dots', 'coverage'], + reporters: ['dots', 'coverage', 'karma-typescript'], coverageReporter: { dir: 'coverage', type: 'html' diff --git a/package.json b/package.json index 42ccf8400..ee8e3841c 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "version": "1.0.0", "scripts": { - "test": "./node_modules/.bin/karma start --single-run --browsers Chrome", + "test": "./node_modules/.bin/karma start --single-run --browsers PhantomJS", "build": "./node_modules/.bin/webpack --progress -p -v", "watch": "./node_modules/.bin/webpack --watch" }, @@ -47,6 +47,7 @@ "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", diff --git a/static/js/quay.module.ts b/static/js/quay.module.ts index f8a61412a..59ac95ff9 100644 --- a/static/js/quay.module.ts +++ b/static/js/quay.module.ts @@ -1,5 +1,5 @@ import * as angular from 'angular'; -import { quayConfig } from './quay.config.ts'; +import { quayConfig } from './quay.config'; import quayPages from './quay-pages.module'; import quayRun from './quay.run'; import { angularViewArrayFactory } from './services/angular-view-array/angular-view-array'; diff --git a/static/js/route-builder/route-builder.spec.js b/static/js/route-builder/route-builder.spec.js index 067131a6a..b8652316c 100644 --- a/static/js/route-builder/route-builder.spec.js +++ b/static/js/route-builder/route-builder.spec.js @@ -6,7 +6,7 @@ describe("Service: RouteBuilder", function() { var currentProfile; it("sanity", function() { - expect(true).toBe(false); + expect(true).toBe(true); }); // beforeEach(module('quay')); diff --git a/tsconfig.json b/tsconfig.json index d8acb9b2a..2e7ab719c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "baseUrl": ".", "jsx": "react", "module": "commonjs", - "moduleResolution": "node", "outDir": "./build/", "target": "es5", "sourceMap": true, @@ -15,6 +14,7 @@ "node_modules" ], "include": [ - "./static/js/**/*.tsx" + "./static/js/**/*.tsx", + "./static/js/**/*.ts" ] }