Vue Project Setup (#8018)
* add files for new client side and reorg gulp tasks * add deps and script for new client * fix webpack paths so that building works * fix static assets not copied into prod build * fix linting * add eslint deps and re-enable it in webpack * add most missing deps for client side and split .babelrc for client * reorganize .eslintignore * update client tests paths and .gitignore * uncomment code * client: move App component * client: update oaths in App component * fix client tests and add more deps * add client side tests to npm test * fix typo in depencency name * update more deps * fix karma.conf.js and upgrade phantomjs * fix dep and move karma.conf to subdirectory * update karma.conf.js position in Gruntfile * try downgrading phantomjs * Fixup client tests (#8032) * Use phantom 2 * fix(tests): Fix refresher test * gitignore translation mock * Update karma version * disable e2e tests for new client from build * write vue templates with pug * add basic routing * remove unnecessary Function.bind shim * remove unused dependency
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import fs from 'fs';
|
||||
import { resetHabiticaDB } from '../../helpers/api-integration/mongo';
|
||||
import { resetHabiticaDB } from '../../helpers/mongo';
|
||||
|
||||
before(async () => {
|
||||
await resetHabiticaDB();
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('AppJS', function() {
|
||||
|
||||
it('should call refresher if idle time is 6 hours or greater', function() {
|
||||
window.awaitIdle();
|
||||
clock.tick(21600000);
|
||||
clock.tick(21900000);
|
||||
expect(window.refresher).to.be.called;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
// Karma configuration
|
||||
// http://karma-runner.github.io/0.10/config/configuration-file.html
|
||||
|
||||
module.exports = function karmaConfig (config) {
|
||||
config.set({
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath: '',
|
||||
|
||||
// testing framework to use (jasmine/mocha/qunit/...)
|
||||
frameworks: ['mocha', 'chai', 'chai-as-promised', 'sinon-chai'],
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'../../../website/client-old/bower_components/jquery/dist/jquery.js',
|
||||
'../../../website/client-old/bower_components/pnotify/jquery.pnotify.js',
|
||||
'../../../website/client-old/bower_components/angular/angular.js',
|
||||
'../../../website/client-old/bower_components/angular-loading-bar/build/loading-bar.min.js',
|
||||
'../../../website/client-old/bower_components/angular-resource/angular-resource.min.js',
|
||||
'../../../website/client-old/bower_components/hello/dist/hello.all.min.js',
|
||||
'../../../website/client-old/bower_components/angular-sanitize/angular-sanitize.js',
|
||||
'../../../website/client-old/bower_components/bootstrap/dist/js/bootstrap.js',
|
||||
'../../../website/client-old/bower_components/angular-bootstrap/ui-bootstrap.js',
|
||||
'../../../website/client-old/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
|
||||
'../../../website/client-old/bower_components/angular-ui-router/release/angular-ui-router.js',
|
||||
'../../../website/client-old/bower_components/angular-filter/dist/angular-filter.js',
|
||||
'../../../website/client-old/bower_components/angular-ui/build/angular-ui.js',
|
||||
'../../../website/client-old/bower_components/angular-ui-utils/ui-utils.min.js',
|
||||
'../../../website/client-old/bower_components/Angular-At-Directive/src/at.js',
|
||||
'../../../website/client-old/bower_components/Angular-At-Directive/src/caret.js',
|
||||
'../../../website/client-old/bower_components/angular-mocks/angular-mocks.js',
|
||||
'../../../website/client-old/bower_components/ngInfiniteScroll/build/ng-infinite-scroll.js',
|
||||
'../../../website/client-old/bower_components/select2/select2.js',
|
||||
'../../../website/client-old/bower_components/angular-ui-select2/src/select2.js',
|
||||
'../../../website/client-old/bower_components/habitica-markdown/dist/habitica-markdown.min.js',
|
||||
'../../../website/client-old/js/habitrpg-shared.js',
|
||||
|
||||
'../../../test/client-old/spec/mocks/**/*.js',
|
||||
|
||||
'../../../website/client-old/js/env.js',
|
||||
'../../../website/client-old/js/app.js',
|
||||
'../../../website/client-old/js/config.js',
|
||||
|
||||
'../../../website/client-old/js/services/**/*.js',
|
||||
'../../../website/client-old/js/filters/**/*.js',
|
||||
'../../../website/client-old/js/directives/**/*.js',
|
||||
'../../../website/client-old/js/controllers/**/*.js',
|
||||
|
||||
'../../../test/client-old/spec/specHelper.js',
|
||||
'../../../test/client-old/spec/**/*.js',
|
||||
],
|
||||
|
||||
// list of files / patterns to exclude
|
||||
exclude: [],
|
||||
|
||||
// web server port
|
||||
port: 8080,
|
||||
|
||||
// level of logging
|
||||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// Start these browsers, currently available:
|
||||
// - Chrome
|
||||
// - ChromeCanary
|
||||
// - Firefox
|
||||
// - Opera
|
||||
// - Safari (only Mac)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
preprocessors: {
|
||||
'../../../website/client-old/js/**/*.js': ['coverage'],
|
||||
'../../../test/**/*.js': ['babel'],
|
||||
},
|
||||
|
||||
coverageReporter: {
|
||||
type: 'lcov',
|
||||
dir: 'coverage/karma',
|
||||
},
|
||||
|
||||
// Enable mocha-style reporting, for better test visibility
|
||||
reporters: ['mocha', 'coverage'],
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, it capture browsers, run tests and exit
|
||||
singleRun: false,
|
||||
});
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user