From 153aa0e34b3fbc6ee1fd965c0ecb8abf36db3b92 Mon Sep 17 00:00:00 2001 From: Brenton Simpson Date: Tue, 21 Nov 2017 10:06:07 -0800 Subject: [PATCH] test(e2e): module-types `esModule: true` is now `type: 'module'`. Test updated to reflect that. --- static/context.html | 7 ++++++- static/debug.html | 7 ++++++- test/e2e/module-types.feature | 20 +++++++++---------- .../support/modules/__tests__/minus.test.mjs | 4 ++-- .../support/modules/__tests__/plus.test.js | 4 ++-- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/static/context.html b/static/context.html index 2da2d0d52..7d1d071ea 100644 --- a/static/context.html +++ b/static/context.html @@ -26,7 +26,12 @@ %SCRIPTS% - + diff --git a/static/debug.html b/static/debug.html index 7d4c45461..3fc6173f2 100644 --- a/static/debug.html +++ b/static/debug.html @@ -28,7 +28,12 @@ %SCRIPTS% - + diff --git a/test/e2e/module-types.feature b/test/e2e/module-types.feature index d4f6153db..7ee5cec0a 100644 --- a/test/e2e/module-types.feature +++ b/test/e2e/module-types.feature @@ -3,23 +3,23 @@ Feature: ES Modules As a person who wants to write great tests I want to use different script types with Karma. - Scenario: Simple middleware + Scenario: Globbing modules, with both .js and .mjs extensions Given a configuration with: """ files = [ - { pattern: 'modules/plus.js', esModule: false }, - { pattern: 'modules/minus.mjs', esModule: true }, - 'modules/test.js' + { pattern: 'modules/**/*.js', type: 'module' }, + { pattern: 'modules/**/*.mjs', type: 'module' }, ]; - browsers = ['Firefox']; + browsers = ['Chrome']; + frameworks = ['mocha', 'chai']; plugins = [ - 'karma-jasmine', - 'karma-firefox-launcher' + 'karma-mocha', + 'karma-chai', + 'karma-chrome-launcher' ]; """ When I start Karma - Then it passes with: + Then it passes with like: """ - .. - Firefox + Executed 4 of 4 SUCCESS """ diff --git a/test/e2e/support/modules/__tests__/minus.test.mjs b/test/e2e/support/modules/__tests__/minus.test.mjs index 1d79390fc..4f1401794 100644 --- a/test/e2e/support/modules/__tests__/minus.test.mjs +++ b/test/e2e/support/modules/__tests__/minus.test.mjs @@ -2,10 +2,10 @@ import { minus } from '../minus.mjs' describe('minus', function () { it('should pass', function () { - expect(true).toBe(true) + expect(true).to.be.true }) it('should work', function () { - expect(minus(3, 2)).toBe(1) + expect(minus(3, 2)).to.equal(1) }) }) diff --git a/test/e2e/support/modules/__tests__/plus.test.js b/test/e2e/support/modules/__tests__/plus.test.js index 291d93491..305f9589f 100644 --- a/test/e2e/support/modules/__tests__/plus.test.js +++ b/test/e2e/support/modules/__tests__/plus.test.js @@ -2,10 +2,10 @@ import { plus } from '../plus.js' describe('plus', function () { it('should pass', function () { - expect(true).toBe(true) + expect(true).to.be.true }) it('should work', function () { - expect(plus(1, 2)).toBe(3) + expect(plus(1, 2)).to.equal(3) }) })