Skip to content

Commit

Permalink
Merge pull request #317 from johnnyreilly/master
Browse files Browse the repository at this point in the history
More execution tests / started explicitly marking babel tests
  • Loading branch information
johnnyreilly committed Oct 15, 2016
2 parents f4efa56 + d36fcea commit 72338f6
Show file tree
Hide file tree
Showing 71 changed files with 155 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Asset Size Chunks Chunk Names
bundle.js 1.74 kB 0 [emitted] main
chunk {0} bundle.js (main) 349 bytes [rendered]
[0] ./.test/es6resolveParent/index.tsx 349 bytes {0} [built]
[0] ./.test/babel-es6resolveParent/index.tsx 349 bytes {0} [built]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
bundle.js 2.76 kB 0 [emitted] main
bundle.js.map 1.66 kB 0 [emitted] main
chunk {0} bundle.js, bundle.js.map (main) 1.23 kB [rendered]
[0] ./.test/issue81/a.ts 1.23 kB {0} [built]
[0] ./.test/babel-issue81/a.ts 1.23 kB {0} [built]
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Asset Size Chunks Chunk Names
bundle.js 1.91 kB 0 [emitted] main
chunk {0} bundle.js (main) 444 bytes [rendered]
[0] ./.test/issue92/app.ts 323 bytes {0} [built]
[1] ./.test/issue92/submodule/submodule.tsx 121 bytes {0} [built]
[0] ./.test/babel-issue92/app.ts 323 bytes {0} [built]
[1] ./.test/babel-issue92/submodule/submodule.tsx 121 bytes {0} [built]
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Asset Size Chunks Chunk Names
bundle.js 2.28 kB 0 [emitted] main
chunk {0} bundle.js (main) 808 bytes [rendered]
[0] ./.test/jsxPreserve/app.tsx 766 bytes {0} [built]
[0] ./.test/babel-jsxPreserve/app.tsx 766 bytes {0} [built]
[1] external "react" 42 bytes {0} [not cacheable]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import mathutils from "mathutils";

export function usingMathutils() {
return `with ${ mathutils.version } we can make ${ mathutils.adder(3, 4) }`;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { usingMathutils } from "../src/simple";

describe("simple", () => {
it("usingMathutils successfully uses the mathutils module", () => {
expect(usingMathutils()).toBe("with 1.2 we can make 7");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"module": "es2015",
"noEmitOnError": false,
"noImplicitAny": true,
"preserveConstEnums": true,
"removeComments": false,
"suppressImplicitAnyIndexErrors": true,
"target": "es2015"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* eslint-disable no-var, strict, prefer-arrow-callback */
'use strict';

var path = require('path');
var webpack = require('webpack');

module.exports = {
entry: './src/simple.ts',
output: {
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.ts(x?)$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015!ts-loader'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
}
}]
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['', '.ts', '.tsx', '.js']
},
};

// for test harness purposes only, you would not need this in a normal project
module.exports.resolveLoader = { alias: { 'ts-loader': path.join(__dirname, "../../../index.js") } }
55 changes: 55 additions & 0 deletions test/execution-tests/babel-es6resolveParent/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* eslint-disable no-var, strict */
'use strict';
var path = require('path');
var webpack = require('webpack');
var webpackConfig = require('./webpack.config.js');

module.exports = function(config) {
config.set({
browsers: [ 'PhantomJS' ],

files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
'main.js'
],

port: 9876,

frameworks: [ 'jasmine' ],

logLevel: config.LOG_INFO, //config.LOG_DEBUG

preprocessors: {
'main.js': [ 'webpack', 'sourcemap' ]
},

webpack: {
devtool: 'inline-source-map',
debug: true,
module: {
loaders: webpackConfig.module.loaders
},
resolve: webpackConfig.resolve,

// for test harness purposes only, you would not need this in a normal project
resolveLoader: webpackConfig.resolveLoader
},

webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},

// reporter options
mochaReporter: {
colors: {
success: 'bgGreen',
info: 'cyan',
warning: 'bgBlue',
error: 'bgRed'
}
}
});
};
4 changes: 4 additions & 0 deletions test/execution-tests/babel-es6resolveParent/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import 'babel-polyfill';

const testsContext = require.context('./', true, /\.tests\.ts(x?)$/);
testsContext.keys().forEach(testsContext);
7 changes: 7 additions & 0 deletions test/execution-tests/babel-es6resolveParent/typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "simple",
"version": false,
"globalDependencies": {
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#fe563dff3428bac1260d1794e2c2ecf8f097535a"
}
}
2 changes: 1 addition & 1 deletion test/execution-tests/basic/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(config) {
browsers: [ 'PhantomJS' ],

files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
// This loads all the tests
'main.js'
],

Expand Down
2 changes: 1 addition & 1 deletion test/execution-tests/codeSplitting/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(config) {
browsers: [ 'PhantomJS' ],

files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
// This loads all the tests
'main.js'
],

Expand Down
2 changes: 1 addition & 1 deletion test/execution-tests/nodeResolution/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(config) {
browsers: [ 'PhantomJS' ],

files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
// This loads all the tests
'main.js'
],

Expand Down
2 changes: 1 addition & 1 deletion test/execution-tests/simpleDependency/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(config) {
browsers: [ 'PhantomJS' ],

files: [
// This ensures we have the es6 shims in place from babel and then loads all the tests
// This loads all the tests
'main.js'
],

Expand Down

0 comments on commit 72338f6

Please sign in to comment.