Tests run now
This commit is contained in:
Родитель
14d30db09d
Коммит
e74a3b45fd
|
@ -4,6 +4,10 @@ A drop-in toolbar to visualize web client performance.
|
|||
# Engineering Spec
|
||||
The [initial engineering spec](https://microsoft.sharepoint.com/:w:/r/teams/Sway/_layouts/15/Doc.aspx?sourcedoc=%7Bb321f8b7-6492-4031-99bf-70c3f5080501%7D&action=edit) is access-limited to Microsoft employees. Once the core version of this tool ships, documentation will need to be updated and that spec will be abandoned in favor of describing, tracking, and planning work in this repository.
|
||||
|
||||
# Getting Started
|
||||
|
||||
1. `npm install`
|
||||
|
||||
# Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,82 @@
|
|||
// Karma configuration
|
||||
// Generated on Thu Dec 14 2017 14:49:02 GMT-0800 (Pacific Standard Time)
|
||||
|
||||
const path = require('path');
|
||||
const webpackConfig = require('./webpack.config');
|
||||
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// 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'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'test/*.ts',
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
],
|
||||
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'test/**/*.ts': ['webpack']
|
||||
},
|
||||
|
||||
webpack: {
|
||||
module: webpackConfig.module,
|
||||
resolve: webpackConfig.resolve,
|
||||
node: {
|
||||
fs: "empty"
|
||||
},
|
||||
},
|
||||
|
||||
mime: { 'text/x-typescript': ['ts','tsx']},
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['Chrome'],
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: false,
|
||||
|
||||
// Concurrency level
|
||||
// how many browser should be started simultaneous
|
||||
concurrency: Infinity,
|
||||
})
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
10
package.json
10
package.json
|
@ -4,7 +4,7 @@
|
|||
"description": "A toolbar for monitoring web performance.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha-webpack --webpack-config webpack.config-test.js",
|
||||
"test": "node .\\node_modules\\karma\\bin\\karma start karma.conf.js",
|
||||
"build": "webpack"
|
||||
},
|
||||
"keywords": [],
|
||||
|
@ -14,8 +14,16 @@
|
|||
"@types/chai": "^4.0.10",
|
||||
"@types/mocha": "^2.2.44",
|
||||
"chai": "^4.1.2",
|
||||
"enzyme": "^3.2.0",
|
||||
"karma": "^1.7.1",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-ie-launcher": "^1.0.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-requirejs": "^1.1.0",
|
||||
"karma-webpack": "^2.0.9",
|
||||
"mocha": "^4.0.1",
|
||||
"mocha-webpack": "^1.0.1",
|
||||
"requirejs": "^2.3.5",
|
||||
"ts-loader": "^3.2.0",
|
||||
"ts-node": "^4.0.1",
|
||||
"typescript": "^2.6.2",
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
var allTestFiles = []
|
||||
var TEST_REGEXP = /(spec|test)\.js$/i
|
||||
|
||||
// Get a list of all the test files to include
|
||||
Object.keys(window.__karma__.files).forEach(function (file) {
|
||||
if (TEST_REGEXP.test(file)) {
|
||||
// Normalize paths to RequireJS module names.
|
||||
// If you require sub-dependencies of test files to be loaded as-is (requiring file extension)
|
||||
// then do not normalize the paths
|
||||
var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '')
|
||||
allTestFiles.push(normalizedTestModule)
|
||||
}
|
||||
})
|
||||
|
||||
require.config({
|
||||
// Karma serves files under /base, which is the basePath from your config file
|
||||
baseUrl: '/base',
|
||||
|
||||
// dynamically load all test files
|
||||
deps: allTestFiles,
|
||||
|
||||
// we have to kickoff jasmine, as it is asynchronous
|
||||
callback: window.__karma__.start
|
||||
})
|
|
@ -10,7 +10,8 @@ module.exports = {
|
|||
use: 'ts-loader',
|
||||
exclude: '/node_modules/'
|
||||
}
|
||||
]
|
||||
],
|
||||
exprContextCritical: false
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js']
|
||||
|
|
Загрузка…
Ссылка в новой задаче