Skip to content

Commit

Permalink
karma test T_T
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzPoize committed Jan 19, 2016
1 parent 3f44a22 commit 072de12
Show file tree
Hide file tree
Showing 27 changed files with 323 additions and 1,181 deletions.
6 changes: 2 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
"presets": ["react", "es2015"],
"plugins": [
"syntax-async-functions",
["transform-async-to-module-method", {
"module": "bluebird",
"method": "coroutine"
}],
"transform-regenerator",
"transform-class-properties"
],
"sourceMaps": true
}
1 change: 0 additions & 1 deletion __prelude.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';

require('babel/polyfill');
const _ = require('lodash');
const Promise = (global || window).Promise = require('bluebird');
1 change: 1 addition & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<body>
<div id="content"></div>
<script type="text/javascript" src="prototypo.js/dist/prototypo.js"></script>
<script type="text/javascript" src="dll/libs.dll.js"></script>
<script type="text/javascript" src="bundle.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/topbar.components.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default class Topbar extends React.Component {
return (
<div id="topbar">
<TopBarMenu>
<TopBarMenuDropdown name="File" id="file-menu" idMenu="file-dropdown" enter={() => { this.onboardExport('export-2') }} leave={() => {this.onboardExport('export')}}>
<TopBarMenuDropdown name="File 2" id="file-menu" idMenu="file-dropdown" enter={() => { this.onboardExport('export-2') }} leave={() => {this.onboardExport('export')}}>
<TopBarMenuDropdownItem name="Logout" handler={() => {this.logout()}}/>
<TopBarMenuDropdownItem name="Restart tutorial" handler={() => {this.startTuto()}}/>
<TopBarMenuDropdownItem name="Export to merged OTF" handler={() => {this.exportOTF(true)}}/>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/helpers/undo-stack.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BatchUpdate {
}
}

export default {
export {
registerToUndoStack,
BatchUpdate,
}
2 changes: 2 additions & 0 deletions app/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pleaseWait from 'please-wait';
debugger;

pleaseWait.instance = pleaseWait.pleaseWait({
logo: '/assets/images/prototypo-loading.svg',
Expand Down Expand Up @@ -267,6 +268,7 @@ else if ( isSafari || isIE ) {
catch(err) {
console.error(err);
location.href = '#/signin';
return;
}

//I know this is ugly but for now it's like this.
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/services/hoodie.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ function setupHoodie(response) {
},
});

IntercomRest.getTags();

Log.setUserId(HoodieApi.instance.email);

if (HoodieApi.eventSub) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/services/typefaces.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ Typefaces.getFont = (repo) => {
});
}

export default {
export {
Typefaces
}
8 changes: 3 additions & 5 deletions app/scripts/services/values.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ function values(prefix) {
}
}

export default {
AppValues: values('newapp'),
FontValues: values('newfont'),
FontInfoValues: values('fontinfos'),
}
export var AppValues = values('newapp');
export var FontValues = values('newfont');
export var FontInfoValues = values('fontinfos');
39 changes: 39 additions & 0 deletions dll.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
var path = require('path');
var webpack = require('webpack');
var node_modules = path.resolve(__dirname, 'node_modules');

module.exports = {
entry: {
libs: [
'react',
'moment',
'babel-polyfill',
'lifespan',
'nexus-flux',
'remutable',
'bluebird',
'react-router',
'jszip',
'xxhashjs',
'pouchdb',
'pouchdb-hoodie-api',
],
},
module: {
noParse: [
/(levelup|lifespan|nexus-flux|remutable)/
]
},
output: {
path: path.join(__dirname, 'dist/dll/'),
filename: '[name].dll.js',
library: '[name]_[hash]',
libraryTarget: 'this'
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, 'dist/dll/', '[name]-manifest.json'),
name: '[name]_[hash]',
})
],
}
48 changes: 42 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ var gulp = require('gulp');
//webpack Dep
var webpack = require('webpack');
var WebpackDevServer= require('webpack-dev-server');
var webpackConfig = require('./webpack.config.js');

//CSS Dep
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var cssnano = require('gulp-cssnano');

//Utils
var del = require('del');
Expand All @@ -20,6 +19,9 @@ var filter = require('gulp-filter');
var autoprefixer = require('gulp-autoprefixer');
var gutil = require('gulp-util');

//Tests
var Server = require('karma').Server;

gulp.task('images', function() {
gulp.src('./app/images/*.*')
.pipe(gulp.dest('./dist/assets/images/'));
Expand All @@ -30,6 +32,8 @@ gulp.task('images', function() {
gulp.task('cp-prototypo.js', function() {
gulp.src('./node_modules/prototypo.js/dist/prototypo.js')
.pipe(gulp.dest('./dist/prototypo.js/dist/'));
gulp.src('./node_modules/prototypo-canvas/src/worker.js')
.pipe(gulp.dest('./dist/prototypo-canvas/src/'));
});

gulp.task('cp-genese', function() {
Expand Down Expand Up @@ -69,8 +73,9 @@ gulp.task('clean',function() {
del.sync(['dist']);
});

gulp.task('webpack', function(callback) {
gulp.task('build', function(callback) {
// run webpack
var webpackConfig = require('./prod.config.js');
var prototypoConfig = Object.create(webpackConfig);
webpack(prototypoConfig,
function(err, stats) {
Expand All @@ -83,10 +88,27 @@ gulp.task('webpack', function(callback) {
);
});

gulp.task("webpack-dev-server",['clean', 'images','css-vendor','css-app','cp-prototypo.js','cp-genese','cp-static'], function(callback) {
gulp.task('clean:dll', function(cb) {
del.sync(['dll']);
});

gulp.task('webpack:dll', function(callback) {
var dllWebpackConfig = require('./dll.config.js');
var prototypoConfig = Object.create(dllWebpackConfig);
webpack(prototypoConfig, function(err, stats) {
if (err) return new gutil.PluginError("webpack", err);

gutil.log('[webpack]', stats.toString({
}));

callback();
});
});

gulp.task('serve',['clean', 'images','css-vendor','css-app','cp-prototypo.js','cp-genese','cp-static','webpack:dll'], function(callback) {
var webpackConfig = require('./webpack.config.js');
// Start a webpack-dev-server
var prototypoConfig = Object.create(webpackConfig);
prototypoConfig.devtool = 'eval';
prototypoConfig.debug = true;
var compiler = webpack(prototypoConfig);

Expand All @@ -100,6 +122,20 @@ gulp.task("webpack-dev-server",['clean', 'images','css-vendor','css-app','cp-pro
gutil.log("[webpack-dev-server]", "http://localhost:9000/webpack-dev-server/index.html");

// keep the server alive or continue?
// callback();
});
});

gulp.task('test', ['clean', 'images','css-vendor','css-app','cp-prototypo.js','cp-genese','cp-static'], function(callback) {
var dllWebpackConfig = require('./prod.config.js');
var prototypoConfig = Object.create(dllWebpackConfig);
webpack(prototypoConfig, function(err, stats) {
if (err) return new gutil.PluginError("webpack", err);

gutil.log('[webpack]', stats.toString({
}));

new Server({
configFile: __dirname + '/karma.conf.js',
}, callback()).start();
});
});
51 changes: 0 additions & 51 deletions karma-e2e.conf.js

This file was deleted.

Loading

0 comments on commit 072de12

Please sign in to comment.