switched to running tests using karma-typescript

This commit is contained in:
alecmerdler 2017-01-19 02:10:00 -08:00
parent 8a9a2972ec
commit bee504d0ba
5 changed files with 10 additions and 13 deletions

View file

@ -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'], frameworks: ['jasmine', 'karma-typescript'],
files: [ files: [
// CDN resources // CDN resources
'node_modules/jquery/dist/jquery.js', 'node_modules/jquery/dist/jquery.js',
@ -28,13 +28,10 @@ module.exports = function(config) {
'static/lib/**/*.js', 'static/lib/**/*.js',
// Application resources // Application resources
'static/js/quay.module.ts', 'static/js/**/*.ts',
// 'static/js/**/*.js',
// Tests // Tests
'static/test/**/*.js', 'static/test/**/*.js',
'static/js/**/*.spec.js',
'static/js/**/*.spec.ts',
], ],
exclude: [ exclude: [
'static/js/build/bundle.js', 'static/js/build/bundle.js',
@ -42,8 +39,7 @@ 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/quay.module.ts': ['webpack'], 'static/js/**/*.ts': ['karma-typescript'],
'static/js/**/*.spec.ts': ['webpack'],
}, },
webpack: { webpack: {
resolve: webpackConfig.resolve, resolve: webpackConfig.resolve,
@ -66,7 +62,7 @@ module.exports = function(config) {
webpackMiddleware: { webpackMiddleware: {
stats: 'errors-only' stats: 'errors-only'
}, },
reporters: ['dots', 'coverage'], reporters: ['dots', 'coverage', 'karma-typescript'],
coverageReporter: { coverageReporter: {
dir: 'coverage', dir: 'coverage',
type: 'html' type: 'html'

View file

@ -4,7 +4,7 @@
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.0",
"scripts": { "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", "build": "./node_modules/.bin/webpack --progress -p -v",
"watch": "./node_modules/.bin/webpack --watch" "watch": "./node_modules/.bin/webpack --watch"
}, },
@ -47,6 +47,7 @@
"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",

View file

@ -1,5 +1,5 @@
import * as angular from 'angular'; import * as angular from 'angular';
import { quayConfig } from './quay.config.ts'; import { quayConfig } from './quay.config';
import quayPages from './quay-pages.module'; import quayPages from './quay-pages.module';
import quayRun from './quay.run'; import quayRun from './quay.run';
import { angularViewArrayFactory } from './services/angular-view-array/angular-view-array'; import { angularViewArrayFactory } from './services/angular-view-array/angular-view-array';

View file

@ -6,7 +6,7 @@ describe("Service: RouteBuilder", function() {
var currentProfile; var currentProfile;
it("sanity", function() { it("sanity", function() {
expect(true).toBe(false); expect(true).toBe(true);
}); });
// beforeEach(module('quay')); // beforeEach(module('quay'));

View file

@ -3,7 +3,6 @@
"baseUrl": ".", "baseUrl": ".",
"jsx": "react", "jsx": "react",
"module": "commonjs", "module": "commonjs",
"moduleResolution": "node",
"outDir": "./build/", "outDir": "./build/",
"target": "es5", "target": "es5",
"sourceMap": true, "sourceMap": true,
@ -15,6 +14,7 @@
"node_modules" "node_modules"
], ],
"include": [ "include": [
"./static/js/**/*.tsx" "./static/js/**/*.tsx",
"./static/js/**/*.ts"
] ]
} }