Skip to content

Commit

Permalink
js: git rid of ts-loader by moving tests in src directory
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Feb 11, 2019
1 parent f357a3a commit 0eb49b7
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 22 deletions.
11 changes: 3 additions & 8 deletions js/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
// Generated on Wed Jun 20 2018 16:46:14 GMT+0200 (CEST)
var webpackConfig = require('./webpack.config.js');
var webpack = require('webpack');
webpackConfig[1].module.rules.push(
{ test: /\.(ts)?$/, use: [ { loader: "ts-loader", options: { transpileOnly: true, } } ] }
)

// console.log(webpackConfig[1].module.rules)


module.exports = function (config) {
Expand All @@ -15,12 +10,12 @@ module.exports = function (config) {
frameworks: ['mocha', 'chai', 'sinon'],
files: [
// we use 1 bundle for testing
{ pattern: 'test/index.ts' },
{ pattern: 'lib/test/index.js' },
],
exclude: ['**/embed.js'],
preprocessors: {
// the bundle goes through webpack, and will emit (inline) source maps, which karma needs to read again
'test/index.ts': ['webpack', 'sourcemap'],
'lib/test/index.js': ['webpack', 'sourcemap'],
},
webpack: {
module: {
Expand All @@ -30,7 +25,7 @@ module.exports = function (config) {
devtool: 'inline-source-map',
mode: 'development',
resolve: {
extensions: ['.ts', '.js']
extensions: ['.js']
},
},
reporters: ['progress', 'mocha'],
Expand Down
11 changes: 2 additions & 9 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
"@types/mocha": "^2.2.48",
"@types/requirejs": "^2.1.31",
"@types/three": "^0.92.4",
"babel-loader": "7.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-without-strict": "0.0.4",
"cache-loader": "^1.2.2",
"chai": "^4.1.2",
"eslint": "^5.13.0",
"eslint-config-standard": "^12.0.0",
Expand All @@ -51,17 +47,13 @@
"karma-mocha-reporter": "^2.2.5",
"karma-sinon": "^1.0.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^3.0.12",
"karma-typescript-es6-transform": "^1.0.4",
"karma-webpack": "^3.0.5",
"mocha": "^3.5.3",
"npm-run-all": "^4.1.3",
"raw-loader": "^0.5.1",
"sinon": "^2.4.1",
"sinon-chai": "^2.11.0",
"source-map-loader": "^0.2.4",
"thread-loader": "^1.2.0",
"ts-loader": "^4.4.2",
"typescript": "~3.0.0",
"url-loader": "^0.5.7",
"webpack": "^4.29.1",
Expand Down Expand Up @@ -89,7 +81,8 @@
"dist/",
"css/",
"src/",
"lib/",
"lib/*.js",
"lib/three/*.js",
"data/",
"glsl/"
]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion js/test/figure.ts → js/src/test/figure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FigureModel, FigureView, WidgetManagerHackModel } from "..";
import { FigureModel, FigureView, WidgetManagerHackModel } from "../..";
import { expect } from 'chai';

describe("figure >", () => {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions js/test/scatter.ts → js/src/test/scatter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// import {Figure} from '../src/Figure.js';
import {DummyManager} from './dummy-manager';
import { ScatterModel, ScatterView, FigureModel, FigureView } from "..";
// import { ScatterModel, ScatterView, FigureModel, FigureView } from "../../";
import { expect } from 'chai';
import {create_model, create_figure_scatter, data_float32} from './widget-utils'
let ipyvolume = require('..');
let ipyvolume = require('../..');

describe("scatter >", () => {
beforeEach(async function() {
Expand Down
2 changes: 1 addition & 1 deletion js/test/selectors.ts → js/src/test/selectors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LassoSelector, CircleSelector, RectangleSelector } from "../lib/selectors.js";
import { LassoSelector, CircleSelector, RectangleSelector } from "../selectors";
import { expect } from 'chai';

const color_inside = [255, 0, 0, 128];
Expand Down
2 changes: 1 addition & 1 deletion js/test/values.ts → js/src/test/values.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Values } from "..";
import { Values } from "../values";
import { expect } from 'chai';

describe("values >", () => {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"target": "es2015",
"outDir": "lib",
"skipLibCheck": true,
"strictNullChecks": false,
// "sourceMap": true,
// inline seems to work better with karma
"inlineSourceMap": true,
Expand Down

0 comments on commit 0eb49b7

Please sign in to comment.