From 8c456aa0fcae61191e99fb691649fc7c6c4b3642 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Tue, 3 Jan 2017 17:33:45 +0000 Subject: [PATCH] Make Karma serve .ts files with executable MIME type, otherwise newer versions of Chrome won't run it. Fixes #499 --- .../ClientApp/app/components/counter/counter.component.spec.ts | 2 +- templates/Angular2Spa/ClientApp/test/karma.conf.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/Angular2Spa/ClientApp/app/components/counter/counter.component.spec.ts b/templates/Angular2Spa/ClientApp/app/components/counter/counter.component.spec.ts index 7eee369..61e49bc 100644 --- a/templates/Angular2Spa/ClientApp/app/components/counter/counter.component.spec.ts +++ b/templates/Angular2Spa/ClientApp/app/components/counter/counter.component.spec.ts @@ -13,7 +13,7 @@ describe('Counter component', () => { }); it('should display a title', async(() => { - const titleText = fixture.nativeElement.querySelector('h2').textContent; + const titleText = fixture.nativeElement.querySelector('h1').textContent; expect(titleText).toEqual('Counter'); })); diff --git a/templates/Angular2Spa/ClientApp/test/karma.conf.js b/templates/Angular2Spa/ClientApp/test/karma.conf.js index e8162c4..a1b4c39 100644 --- a/templates/Angular2Spa/ClientApp/test/karma.conf.js +++ b/templates/Angular2Spa/ClientApp/test/karma.conf.js @@ -18,6 +18,7 @@ module.exports = function (config) { logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], + mime: { 'application/javascript': ['ts','tsx'] }, singleRun: false, webpack: require('../../webpack.config.js').filter(config => config.target !== 'node'), // Test against client bundle, because tests run in a browser webpackMiddleware: { stats: 'errors-only' }