-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from martinRenou/typescript
JavaScript -> TypeScript
- Loading branch information
Showing
20 changed files
with
3,211 additions
and
1,774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ node_modules/ | |
|
||
# Compiled javascript | ||
ipysheet/static/ | ||
js/lib/* | ||
|
||
# OS X | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,52 @@ | ||
// Karma configuration | ||
// Generated on Fri Apr 14 2017 18:21:49 GMT+0200 (CEST) | ||
//var webpackConfig = require('./webpack.config')[1]; | ||
// Generated on Wed Jun 20 2018 16:46:14 GMT+0200 (CEST) | ||
var webpackConfig = require('./webpack.config.js'); | ||
var webpack = require('webpack'); | ||
const process = require('process'); | ||
process.env.CHROME_BIN = require('puppeteer').executablePath(); | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['mocha', 'chai', 'karma-typescript'], | ||
files: [ | ||
{pattern: 'test/*.ts'}, | ||
{pattern: 'src/*.js', included: false, served: false}, | ||
], | ||
exclude: ['**/embed.js'], | ||
preprocessors: { | ||
'test/**/*.ts': [ 'karma-typescript'] | ||
}, | ||
karmaTypescriptConfig: { | ||
bundlerOptions: { | ||
transforms: [ | ||
require("karma-typescript-es6-transform")() | ||
] | ||
}, | ||
compilerOptions: { | ||
target: "es5", | ||
sourceMap: true | ||
}, | ||
coverageOptions: { | ||
exclude: [/\.(d|test)\.ts$/i, /.*node_modules.*/] | ||
}, | ||
tsconfig: "./test/tsconfig.json" | ||
}, | ||
webpack: { | ||
module: { | ||
rules: [ | ||
{ test: /\.json$/, user: 'json-loader' }, | ||
{ test: /\.css$/, use: ['style-loader', 'css-loader']}, | ||
{ test: /\.tsx?$/, exclude: /node_modules/, use: 'ts-loader'} | ||
] | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.js', ''], | ||
alias: {'handsontable$': '../src/handsontable_fix.js'} | ||
}, | ||
devtool: 'inline-source-map', | ||
}, | ||
mime: { | ||
"text/x-typescript": ["ts", "tsx"], | ||
}, | ||
reporters: ['progress'], | ||
port: 9876, | ||
colors: true, | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['HeadlessChrome'], | ||
customLaunchers: { | ||
HeadlessChrome: { | ||
base: 'ChromeHeadless', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false, | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}) | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['mocha', 'chai', 'sinon'], | ||
files: [ | ||
// we use 1 bundle for testing | ||
{ pattern: 'lib/src/test/sheet.js' }, | ||
], | ||
exclude: ['**/embed.js'], | ||
preprocessors: { | ||
// the bundle goes through webpack, and will emit (inline) source maps, which karma needs to read again | ||
'lib/src/test/sheet.js': ['webpack', 'sourcemap'], | ||
}, | ||
webpack: { | ||
module: { | ||
rules: webpackConfig[2].module.rules | ||
}, | ||
// source mapping without inline does not seem to work | ||
devtool: 'inline-source-map', | ||
mode: 'development', | ||
resolve: { | ||
extensions: ['.js'] | ||
}, | ||
}, | ||
reporters: ['progress', 'mocha'], | ||
port: 9876, | ||
colors: true, | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['HeadlessChrome'], | ||
customLaunchers: { | ||
HeadlessChrome: { | ||
base: 'ChromeHeadless', | ||
flags: ['--no-sandbox'] | ||
} | ||
}, | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: true, | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}) | ||
} |
Oops, something went wrong.