diff --git a/.babelrc b/.babelrc
index 9224ca318..f5c3648de 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,17 +1,13 @@
{
"presets": ["react", "es2015", "stage-0"],
"plugins": [
+ "react-require",
"transform-runtime",
"add-module-exports",
"transform-decorators-legacy",
- "transform-react-display-name"
+ "transform-react-display-name",
],
"env": {
- "test": {
- "plugins": [
- "rewire"
- ]
- },
"development": {
"plugins": [
"typecheck"
diff --git a/karma.conf.js b/karma.conf.js
deleted file mode 100644
index d21d97f4a..000000000
--- a/karma.conf.js
+++ /dev/null
@@ -1,146 +0,0 @@
-var webpack = require('webpack');
-
-module.exports = function(config) {
- config.set({
-
- // base path that will be used to resolve all patterns (eg. files, exclude)
- basePath: '',
-
- plugins: [
- 'karma-sourcemap-loader',
- 'karma-mocha',
- 'karma-chai-sinon',
- 'karma-sinon',
- 'karma-webpack',
- 'karma-chrome-launcher',
- 'karma-phantomjs-launcher'
- ],
-
- // frameworks to use
- // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
- frameworks: ['mocha', 'chai-sinon', 'sinon'],
-
- // list of files / patterns to load in the browser
- files: [
- './node_modules/phantomjs-polyfill/bind-polyfill.js',
- './tests/polyfill/Event.js',
- {pattern: 'static/images/*', watched: false, included: false, served: true},
-
- // Actual tests here
- 'tests.webpack.js'
- ],
-
- // list of files to exclude
- exclude: [
- ],
-
- proxies: {
- '/images': __dirname + '/static/images',
- '/images/': __dirname + '/static/images/',
- },
-
- proxyValidateSSL: false,
-
- // preprocess matching files before serving them to the browser
- // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessors
-
- preprocessors: {
- 'tests.webpack.js': [ 'webpack', 'sourcemap' ]
- },
-
- webpack: {
- externals: {
- 'cheerio': 'window',
- 'react/addons': true,
- 'react/lib/ExecutionEnvironment': true,
- 'react/lib/ReactContext': true
- },
- resolve: {
- modules: [
- 'src',
- 'node_modules'
- ],
- extensions: ['', '.json', '.js']
- },
-
- module: {
- loaders: [
- {
- test: /\.(js|jsx)$/,
- exclude: [/server/, /node_modules/, /tests/],
- loader: 'babel'
- },
- { test: /\.json$/, loader: 'json-loader'},
- { test: /\.scss$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap' },
- { test: /\.(jpe?g|png|gif|svg)$/, loader: 'url', query: {limit: 10240} }
- ]
- },
-
- devtool: 'inline-source-map',
-
- node: {
- // karma watches test/unit/index.js
- // webpack watches dependencies of test/unit/index.js
- fs: 'empty'
- },
-
- plugins:[
- new webpack.DefinePlugin({
- __CLIENT__: true,
- __SERVER__: false,
- __DEVELOPMENT__: true,
- __DEVTOOLS__: false // <-------- DISABLE redux-devtools HERE
- })
- ],
-
- watch: true
- },
-
- webpackMiddleware: { noInfo: true },
-
- client: {
- mocha: {
- globals: []
- }
- },
-
- // test results reporter to use
- // possible values: 'dots', 'progress'
- // available reporters: https://npmjs.org/browse/keyword/karma-reporter
- reporters: ['progress'],
-
- junitReporter: {
- outputFile: 'test-results.xml',
- suite: ''
- },
-
- // web server port
- port: 9876,
-
-
- // enable / disable colors in the output (reporters and logs)
- colors: true,
-
-
- // level of logging
- // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
- logLevel: config.LOG_INFO,
-
-
- // enable / disable watching file and executing tests whenever any file changes
- autoWatch: true,
-
-
- // start these browsers
- // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
- // browsers: ['Chrome', 'PhantomJS'],
- browsers: ['Chrome'],
-
- // webpack means that PhantomJS sometimes does not respond in time
- browserNoActivityTimeout: 120000,
-
- // Continuous Integration mode
- // if true, Karma captures browsers, runs the tests and exits
- singleRun: false
- });
-};
diff --git a/package.json b/package.json
index f2dabac83..fff545f43 100644
--- a/package.json
+++ b/package.json
@@ -3,11 +3,11 @@
"version": "1.0.0",
"private": false,
"scripts": {
- "test": "./node_modules/karma/bin/karma start",
- "test:ci:unit": "./node_modules/karma/bin/karma start --browsers PhantomJS --single-run; npm run test:ci:lint",
+ "test": "NODE_ENV=test jasmine JASMINE_CONFIG_PATH='./tests/jasmine.json'",
+ "test:ci:unit": "npm test && npm run test:ci:lint",
"test:ci:functional": "node ./nightwatch.js -c ./nightwatch.json -e production",
"test:ci:lint": "eslint ./src/**/*.js",
- "test:dev:unit": "./node_modules/karma/bin/karma start",
+ "test:dev:unit": "npm test",
"test:dev:functional": "node ./nightwatch.js -c ./nightwatch.json",
"test:dev:lint": "eslint ./src/scripts/**/*.js",
"dev": "node webpack/dev-server.js & PORT=8000 node start.js",
@@ -109,6 +109,7 @@
"devDependencies": {
"babel-core": "^6.7.7",
"babel-eslint": "^6.0.4",
+ "babel-plugin-react-require": "^2.1.0",
"babel-plugin-react-transform": "^2.0.2",
"babel-preset-react-hmre": "^1.1.1",
"chai": "^3.0.0",
@@ -121,18 +122,10 @@
"eslint-plugin-import": "^1.8.1",
"eslint-plugin-jsx-a11y": "^1.5.3",
"eslint-plugin-react": "^5.2.2",
+ "jasmine": "^2.4.1",
+ "jasmine-spec-reporter": "^2.5.0",
"jscs": "^2.1.1",
- "karma": "^0.13.9",
- "karma-chai": "^0.1.0",
- "karma-chai-sinon": "^0.1.5",
- "karma-chrome-launcher": "^0.2.0",
- "karma-junit-reporter": "^0.3.4",
- "karma-mocha": "^0.2.0",
- "karma-phantomjs-launcher": "~0.2.1",
- "karma-script-launcher": "~0.1.0",
- "karma-sinon": "^1.0.4",
- "karma-sourcemap-loader": "^0.3.7",
- "karma-webpack": "^1.6.0",
+ "jsdom": "^8.0.2",
"mocha": "^2.2.5",
"nightwatch": "^0.8.6",
"nodemon": "^1.7.1",
@@ -147,7 +140,7 @@
"redux-devtools-dock-monitor": "^1.1.0",
"redux-devtools-log-monitor": "^1.0.5",
"selenium-server": "^2.48.2",
- "sinon": "^1.15.3",
+ "sinon": "^1.17.4",
"sinon-chai": "^2.8.0",
"webpack-dev-server": "^1.6.5"
},
diff --git a/src/components/Ayah/spec.js b/src/components/Ayah/ayah.test.js
similarity index 51%
rename from src/components/Ayah/spec.js
rename to src/components/Ayah/ayah.test.js
index 1942a87c5..49909fe43 100644
--- a/src/components/Ayah/spec.js
+++ b/src/components/Ayah/ayah.test.js
@@ -1,26 +1,27 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
import { shallow } from 'enzyme';
-
-import Ayah from './index';
-
+import Ayah from './index.js';
import ayah from '../../../tests/fixtures/ayah';
+
let wrapper;
-describe('