GithubHelp home page GithubHelp logo

tomastrajan / angular-js-es6-testing-example Goto Github PK

View Code? Open in Web Editor NEW
171.0 171.0 39.0 1.98 MB

Enhanced testing of Angular JS 1.X applications using ES6 modules

License: MIT License

JavaScript 50.36% HTML 44.26% CSS 3.11% Shell 2.27%
angularjs es2015 es6 mocha testing

angular-js-es6-testing-example's People

Contributors

rememberlenny avatar simon04 avatar spyder1472 avatar tomastrajan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-js-es6-testing-example's Issues

Argument 'fn' is not a function, got string

Do you not get this error on your second test?

On my first test, this line will work angular.mock.module('app'); but on my second it it will not and will throw that error.

TypeError: realRunner.done is not a function

Not really crucial, just wanted to let you know this.

Switching features throws this in the console.
(Don't see any problem though unless I open the console.)

TypeError: realRunner.done is not a function
    at angular-animate.js:2473
    at Scope.$digest (angular.js:15946)
    at Scope.$apply (angular.js:16160)
    at angular.js:17927
    at completeOutstandingRequest (angular.js:5552)
    at angular.js:5829

question how to exclude webpack.karma.context.js from coverage report

hi Tomas @tomastrajan I found my webpack.karma.context.js is included in coverage report,how can I exclude it? thanks

context

webpack.karma.context.js
let context = require.context('./app', true, /\.js/); context.keys().forEach(context);

karma.conf.js
`var webpack = require('webpack');
var path = require('path');
var webpackConfig = require('./webpack.config');

webpackConfig.entry = {};
webpackConfig.output = {};
webpackConfig.module.preLoaders = [
{
test: /.test.js$/,
include: /app/,
exclude: /node_modules/,
loader: 'babel',
query: {
cacheDirectory: true,
},
},
{
test: /.js?$/,
include: /app/,
exclude: [/node_modules/, /.test.js$/, /webpack.karma.context.js/],
loader: 'babel-istanbul',
query: {
cacheDirectory: true,
},
},
{
test: /.html$/,
loader: 'html',
query: {
minimize: true
}
}
];

module.exports = function(config) {
config.set({
browsers: ['Chrome'],
frameworks: ['jasmine'],
reporters: ['progress', 'coverage', 'spec'],
coverageReporter: {
// output coverage reports
//type : 'html',
dir : 'coverage/',
reporters: [
{ type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
{type: 'html', dir : 'coverage/',}
],
includeAllSources: true
},
logLevel: config.LOG_INFO, //config.LOG_INFO, config.LOG_DEBUG
autoWatch: true,
singleRun: false,
colors: true,
port: 9876,
basePath: '',

	webpack:webpackConfig,
	files: [ { pattern: 'webpack.karma.context.js', watched: false } ],
    preprocessors: { 'webpack.karma.context.js': ['webpack', 'sourcemap', 'coverage'] },
    exclude: [],
	webpackServer: {
		noInfo: true,
	},
	concurrency: Infinity,
	plugins:[
    require('karma-webpack'),
    'karma-chrome-launcher',
	'karma-jasmine',
	'karma-coverage',
	'karma-spec-reporter',
	'karma-sourcemap-loader'
	]
});

};`

webpack.config.js

`var webpack = require('webpack');
const prod = process.argv.indexOf('-p') !== -1;

/*

  • Default webpack configuration for development
    */
    var config = {
    devtool: 'inline-source-map', //devtool: 'source-map',
    entry: {
    ngApp : __dirname + "/app/ngApp.js",
    },
    output: {
    path: __dirname + "/public",
    filename: "[name].bundle.js"
    },
    module: {
    preLoaders: [
    {
    test: /.js?$/,
    include: /app/,
    exclude: [/node_modules/, /.test.js$/, /webpack.karma.context.js/],
    loader: 'babel',
    query: {
    cacheDirectory: true,
    },
    },
    {
    test: /.html$/,
    loader: 'html',
    query: {
    minimize: true
    }
    }
    ],
    loaders: [
    {
    test: /.js$/,
    include: /app/,
    exclude: [/node_modules/, /.test.js$/, /webpack.karma.context.js/],
    loader: 'babel',
    },
    {
    test: /.html$/,
    loader: 'html',
    query: {
    minimize: true
    }
    }
    ]
    },
    devServer: {
    contentBase: "./public",
    colors: true,
    historyApiFallback: true,
    inline: true
    },
    plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.ProvidePlugin({
    $: 'jquery',
    jQuery: 'jquery'
    })
    ]
    }

if (prod) { config.devtool = false;
config.plugins.push( new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}) );
config.plugins.push( new webpack.optimize.UglifyJsPlugin({ minimize: true, comments: false, compressor:{warnings:false} }) );
};
module.exports = config;
`

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/mocha-babel

Sadly also problems here:

$ npm install

...

npm ERR! Darwin 12.6.0
npm ERR! argv "/usr/local/bin/node" "/Users/dmitrizaitsev/.npm-global/bin/npm" "i" "-d"
npm ERR! node v4.2.4
npm ERR! npm  v3.5.3
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/mocha-babel
npm ERR! 404 
npm ERR! 404  'mocha-babel' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'angular-js-es6-testing-example'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/dmitrizaitsev/Repos/angular-js-es6-testing-example/npm-debug.log

'csslint.' is not in the npm registry.

Hi ,
I am trying to install csslint through sublimeLinter.I keep getting the following error :

Darwin 13.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "csslint."
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/csslint.
npm ERR! 404
npm ERR! 404 'csslint.' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Here is the content from the log file :

node_modules/npm/node_modules/npm-registry-client/lib/request.js:280:14)
27 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:210:14)
27 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:187:22)
27 verbose stack at emitTwo (events.js:106:13)
27 verbose stack at Request.emit (events.js:191:7)
27 verbose stack at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1048:10)
27 verbose stack at emitOne (events.js:96:13)
27 verbose stack at Request.emit (events.js:188:7)
27 verbose stack at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:969:12)
28 verbose statusCode 404
29 verbose pkgid csslint.
30 verbose cwd /private/var/root
31 error Darwin 13.4.0
32 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "csslint."
33 error node v6.9.5
34 error npm v3.10.10
35 error code E404
36 error 404 Registry returned 404 for GET on https://registry.npmjs.org/csslint.
37 error 404
38 error 404 'csslint.' is not in the npm registry.
39 error 404 You should bug the author to publish it (or use the name yourself!)
40 error 404 Note that you can also install from a
41 error 404 tarball, folder, http url, or git url.
42 verbose exit [ 1, true ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.