How to use the @microsoft/web-library-build.karma function in @microsoft/web-library-build

To help you get started, we’ve selected a few @microsoft/web-library-build examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / rushstack / build-tests / web-library-build-test / karma.config.js View on Github external
'use strict';

// Karma configuration
// Generated on Thu Oct 08 2015 18:13:05 GMT-0700 (PDT)

let path = require('path');
let build = require('@microsoft/web-library-build');
let configResources = build.karma.resources;

let bindPolyfillPath = configResources.bindPolyfillPath;
let debugRun = (process.argv.indexOf('--debug') > -1);

let testsFilePath = path.join(build.getConfig().tempFolder, 'tests.js');

module.exports = function(config) {
  let karmaConfig = {

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '.',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'sinon-chai'],
github OfficeDev / office-ui-fabric-react / packages / experiments / gulpfile.js View on Github external
'use strict';

let build = require('@microsoft/web-library-build');
let gulp = require('gulp');

// Short aliases for subtasks.
build.task('webpack', build.webpack);
build.task('sass', build.sass);
build.task('karma', build.karma);
build.task('ts', build.typescript);
build.task('tslist', build.tslint);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});
github OfficeDev / office-ui-fabric-react / packages / experiments / gulpfile.js View on Github external
let build = require('@microsoft/web-library-build');
let gulp = require('gulp');

// Short aliases for subtasks.
build.task('webpack', build.webpack);
build.task('sass', build.sass);
build.task('karma', build.karma);
build.task('ts', build.typescript);
build.task('tslist', build.tslint);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});
github OfficeDev / office-ui-fabric-react / apps / fabric-website / gulpfile.js View on Github external
{},
  require('./node_modules/@microsoft/gulp-core-build-typescript/lib/defaultTslint.json').rules,
  require('./node_modules/office-ui-fabric-react-tslint/tslint.json').rules,
  require('./tslint.json').rules
);

// Configure TypeScript.
build.TypeScriptConfiguration.setTypescriptCompiler(require('typescript'));
// Use css modules.
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});

// Use Karma Tests - Disable during develoment if prefered
build.karma.isEnabled = () => false;

// Disable unnecessary subtasks.
build.preCopy.isEnabled = () => false;

// Disable tslint
build.tslint.isEnabled = () => false;

// Only run bundling in production builds; this speeds up normal ci builds.
build.webpack.isEnabled = () => isProduction;

// Copy fabric-core to dist to be published with fabric-react.
build.postCopy.setConfig({
  shouldFlatten: false,
  copyTo: {
    [path.join(distFolder, 'sass')]: [
      'node_modules/office-ui-fabric-core/dist/sass/**/*.*'
github microsoft / rushstack / core-build / gulp-core-build-karma / karma.config.js View on Github external
'use strict';

// Karma configuration
// Generated on Thu Oct 08 2015 18:13:05 GMT-0700 (PDT)

let path = require('path');
let build = require('@microsoft/web-library-build');
let configResources = build.karma.resources;

let bindPolyfillPath = configResources.bindPolyfillPath;
let debugRun = (process.argv.indexOf('--debug') > -1);

let testsFilePath = path.join(build.getConfig().tempFolder, 'tests.js');

module.exports = function(config) {
  let karmaConfig = {

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '.',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'sinon-chai'],
github OfficeDev / office-ui-fabric-react / apps / fabric-website / karma.config.js View on Github external
'use strict';

// Karma configuration
// Generated on Thu Oct 08 2015 18:13:05 GMT-0700 (PDT)

let path = require('path');
let configResources = require('@microsoft/web-library-build').karma.resources;
let bindPolyfillPath = configResources.bindPolyfillPath;
let debugRun = (process.argv.indexOf('--debug') > -1);

module.exports = function(config) {
  let karmaConfig = {

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '.',

    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'sinon-chai'],


    // list of files / patterns to load in the browser
    files: [bindPolyfillPath].concat(['lib/common/tests.js']),
github OfficeDev / office-ui-fabric-react / packages / example-app-base / gulpfile.js View on Github external
'use strict';

let build = require('@microsoft/web-library-build');
let gulp = require('gulp');

// Short aliases for subtasks.
build.task('webpack', build.webpack);
build.task('sass', build.sass);
build.task('karma', build.karma);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});
github OfficeDev / office-ui-fabric-react / packages / merge-styles / gulpfile.js View on Github external
'use strict';

let gulp = require('gulp');
let build = require('@microsoft/web-library-build');

build.task('tslint', build.tslint);
build.task('sass', build.sass);
build.task('karma', build.karma);
build.task('webpack', build.webpack);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});
github OfficeDev / office-ui-fabric-react / packages / styling / gulpfile.js View on Github external
'use strict';

let gulp = require('gulp');
let build = require('@microsoft/web-library-build');

build.task('sass', build.sass);
build.task('karma', build.karma);

// initialize tasks.
build.initialize(gulp);

// Always fail on test failures.
build.karma.setConfig({
  failBuildOnErrors: true
});

// Use css modules.
build.sass.setConfig({
  useCSSModules: true,
  moduleExportName: ''
});