Skip to content

Instantly share code, notes, and snippets.

Avatar

Abdoulaye K. Traoré aktraore

View GitHub Profile
@aktraore
aktraore / app-jest-config.json
Created Apr 27, 2018
Application Jest configuration
View app-jest-config.json
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/src/**/*.ts",
"!<rootDir>/src/*.d.ts"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/src-test/",
"/dist/"
View babelrc.json
{
"env": {
"test": {
"plugins": ["transform-es2015-modules-commonjs"]
}
}
}
@aktraore
aktraore / lib-jest.json
Created Apr 27, 2018
Library jest configuration
View lib-jest.json
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/src/**/*.ts",
"!<rootDir>/src/*.d.ts"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/src-test/",
"/dist/"
@aktraore
aktraore / init.ts
Created Apr 27, 2018
Jest init file for AngularJS
View init.ts
import * as angular from "angular";
import jQuery from 'jquery';
Object.defineProperty(window, "jQuery", { value: jQuery });
Object.defineProperty(window, "$", { value: jQuery });
Object.defineProperty(window, "angular", { value: angular });
import "angular-mocks";
@aktraore
aktraore / htmlLoader.ts
Created Apr 27, 2018
Jest htm loader preprocessor
View htmlLoader.ts
const htmlLoader = require('html-loader');
module.exports = {
process(src, filename, config, options) {
return htmlLoader(src);
}
}
View lib-karma-config.js
var tsconfig = require('./tsconfig.json');
// set global environment variable CHROME_BIN=chromium-browser
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai', 'sinon-chai', 'chai-as-promised', 'karma-typescript'],
@aktraore
aktraore / app-karma-config.js
Created Apr 27, 2018
application karma config
View app-karma-config.js
var _ = require('lodash');
var appConfig = require('./app-config.json');
// Check for custom app configuration, override if necessary
try {
var customConfig = require('./app-config-custom.json');
_.merge(customConfig, appConfig, _.defaults);
appConfig = customConfig;
} catch (e) {
You can’t perform that action at this time.