Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
20
my-app/node_modules/karma-jasmine/LICENSE
generated
vendored
Executable file
20
my-app/node_modules/karma-jasmine/LICENSE
generated
vendored
Executable file
|
@ -0,0 +1,20 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (C) 2011-2013 Google, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
112
my-app/node_modules/karma-jasmine/README.md
generated
vendored
Executable file
112
my-app/node_modules/karma-jasmine/README.md
generated
vendored
Executable file
|
@ -0,0 +1,112 @@
|
|||
# karma-jasmine
|
||||
|
||||
[](https://www.npmjs.com/package/karma-jasmine)
|
||||
[](https://www.npmjs.com/package/karma-jasmine)
|
||||
[](https://github.com/karma-runner/karma-jasmine/actions/workflows/release.yml?query=branch%3Amaster)
|
||||
[](https://github.com/karma-runner/karma-jasmine)
|
||||
[](https://github.com/semantic-release/semantic-release)
|
||||
|
||||
> Adapter for the [Jasmine](https://jasmine.github.io/) testing framework.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install karma-jasmine --save-dev
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
```js
|
||||
// karma.conf.js
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
frameworks: ['jasmine'],
|
||||
files: [
|
||||
'*.js'
|
||||
]
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
If you want to run only some tests whose name match a given pattern you can do this in the following way
|
||||
|
||||
```bash
|
||||
$ karma start &
|
||||
$ karma run -- --grep=<pattern>
|
||||
```
|
||||
|
||||
where pattern is either a string (e.g `--grep=#slow` runs tests containing "#slow") or a Regex (e.g `--grep=/^(?!.*#slow).*$/` runs tests _not_ containing "#slow").
|
||||
|
||||
You can also pass it to `karma.config.js`:
|
||||
|
||||
```js
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
// ...
|
||||
client: {
|
||||
args: ['--grep', '<pattern>'],
|
||||
// ...
|
||||
}
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
If you want to pass configuration options directly to jasmine you can do this in the following way
|
||||
|
||||
```js
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
client: {
|
||||
jasmine: {
|
||||
random: true,
|
||||
seed: '4321',
|
||||
oneFailurePerSpec: true,
|
||||
failFast: true,
|
||||
timeoutInterval: 1000
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
## Debug by URL
|
||||
|
||||
Failing tests print a debug URL with `?spec=`. Use it with `--no_single_run`
|
||||
and paste it into your browser to focus on a single failing test.
|
||||
|
||||
## Sharding
|
||||
|
||||
By setting `config.client.shardIndex` and `config.client.totalShards`, you can
|
||||
run a subset of the full set of specs. Complete sharding support needs to be
|
||||
done in the process that calls karma, and would need to support test result
|
||||
integration across shards.
|
||||
|
||||
## Custom spec filter
|
||||
|
||||
Providing a [custom spec filter](https://jasmine.github.io/api/edge/Configuration#specFilter) is also supported.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
// Users are able to set a custom specFilter themselves
|
||||
|
||||
jasmine.getEnv().configure({
|
||||
specFilter: function (spec) {
|
||||
return spec.getFullName() === 'spec that succeeds'
|
||||
}
|
||||
})
|
||||
|
||||
describe('spec', () => {
|
||||
it('that fails', () => {
|
||||
fail('This spec should not run!')
|
||||
})
|
||||
|
||||
it('that succeeds', () => {
|
||||
expect(1).toBe(1)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
For more information on Karma see the [homepage](https://karma-runner.github.io/).
|
564
my-app/node_modules/karma-jasmine/lib/adapter.js
generated
vendored
Executable file
564
my-app/node_modules/karma-jasmine/lib/adapter.js
generated
vendored
Executable file
|
@ -0,0 +1,564 @@
|
|||
(function(window) {
|
||||
|
||||
/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "(createSpecFilter|createStartFn)" }] */
|
||||
|
||||
'use strict'
|
||||
|
||||
// Save link to native Date object
|
||||
// before it might be mocked by the user
|
||||
var _Date = Date
|
||||
|
||||
/**
|
||||
* Decision maker for whether a stack entry is considered external to jasmine and karma.
|
||||
* @param {String} entry Error stack entry.
|
||||
* @return {Boolean} True if external, False otherwise.
|
||||
*/
|
||||
function isExternalStackEntry (entry) {
|
||||
return !!entry &&
|
||||
// entries related to jasmine and karma-jasmine:
|
||||
!/\/(jasmine-core|karma-jasmine)\//.test(entry) &&
|
||||
// karma specifics, e.g. "at http://localhost:7018/karma.js:185"
|
||||
!/\/(karma.js|context.html):/.test(entry)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns relevant stack entries.
|
||||
* @param {Array} stack frames
|
||||
* @return {Array} A list of relevant stack entries.
|
||||
*/
|
||||
function getRelevantStackFrom (stack) {
|
||||
var filteredStack = []
|
||||
var relevantStack = []
|
||||
|
||||
for (var i = 0; i < stack.length; i += 1) {
|
||||
if (isExternalStackEntry(stack[i])) {
|
||||
filteredStack.push(stack[i])
|
||||
}
|
||||
}
|
||||
|
||||
// If the filtered stack is empty, i.e. the error originated entirely from within jasmine or karma, then the whole stack
|
||||
// should be relevant.
|
||||
if (filteredStack.length === 0) {
|
||||
filteredStack = stack
|
||||
}
|
||||
|
||||
for (i = 0; i < filteredStack.length; i += 1) {
|
||||
if (filteredStack[i]) {
|
||||
relevantStack.push(filteredStack[i])
|
||||
}
|
||||
}
|
||||
|
||||
return relevantStack
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom formatter for a failed step.
|
||||
*
|
||||
* Different browsers report stack trace in different ways. This function
|
||||
* attempts to provide a concise, relevant error message by removing the
|
||||
* unnecessary stack traces coming from the testing framework itself as well
|
||||
* as possible repetition.
|
||||
*
|
||||
* @see https://github.com/karma-runner/karma-jasmine/issues/60
|
||||
* @param {Object} step Step object with stack and message properties.
|
||||
* @return {String} Formatted step.
|
||||
*/
|
||||
function formatFailedStep (step) {
|
||||
var relevantMessage = []
|
||||
var relevantStack = []
|
||||
|
||||
// Safari/Firefox seems to have no stack trace,
|
||||
// so we just return the error message and if available
|
||||
// construct a stacktrace out of filename and lineno:
|
||||
if (!step.stack) {
|
||||
if (step.filename) {
|
||||
var stackframe = step.filename
|
||||
if (step.lineno) {
|
||||
stackframe = stackframe + ':' + step.lineno
|
||||
}
|
||||
relevantStack.push(stackframe)
|
||||
}
|
||||
relevantMessage.push(step.message)
|
||||
return relevantMessage.concat(relevantStack).join('\n')
|
||||
}
|
||||
|
||||
// Remove the message prior to processing the stack to prevent issues like
|
||||
// https://github.com/karma-runner/karma-jasmine/issues/79
|
||||
var stackframes = step.stack.split('\n')
|
||||
var messageOnStack = null
|
||||
if (stackframes[0].indexOf(step.message) !== -1) {
|
||||
// Remove the message if it is in the stack string (eg Chrome)
|
||||
messageOnStack = stackframes.shift()
|
||||
}
|
||||
// Filter frames
|
||||
var relevantStackFrames = getRelevantStackFrom(stackframes)
|
||||
if (messageOnStack) {
|
||||
// Put the message back if we removed it.
|
||||
relevantStackFrames.unshift(messageOnStack)
|
||||
} else {
|
||||
// The stack did not have the step.message so add it.
|
||||
relevantStackFrames.unshift(step.message)
|
||||
}
|
||||
|
||||
return relevantStackFrames.join('\n')
|
||||
}
|
||||
|
||||
function debugUrl (description) {
|
||||
// A link to re-run just one failed test case.
|
||||
return window.location.origin + '/debug.html?spec=' + encodeURIComponent(description)
|
||||
}
|
||||
|
||||
function SuiteNode (name, parent) {
|
||||
this.name = name
|
||||
this.parent = parent
|
||||
this.children = []
|
||||
|
||||
this.addChild = function (name) {
|
||||
var suite = new SuiteNode(name, this)
|
||||
this.children.push(suite)
|
||||
return suite
|
||||
}
|
||||
}
|
||||
|
||||
function processSuite (suite, pointer) {
|
||||
var child
|
||||
var childPointer
|
||||
|
||||
for (var i = 0; i < suite.children.length; i++) {
|
||||
child = suite.children[i]
|
||||
|
||||
if (child.children) {
|
||||
childPointer = pointer[child.description] = { _: [] }
|
||||
processSuite(child, childPointer)
|
||||
} else {
|
||||
if (!pointer._) {
|
||||
pointer._ = []
|
||||
}
|
||||
pointer._.push(child.description)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getAllSpecNames (topSuite) {
|
||||
var specNames = {}
|
||||
|
||||
processSuite(topSuite, specNames)
|
||||
|
||||
return specNames
|
||||
}
|
||||
|
||||
/**
|
||||
* Very simple reporter for Jasmine.
|
||||
*/
|
||||
function KarmaReporter (tc, jasmineEnv) {
|
||||
var currentSuite = new SuiteNode()
|
||||
|
||||
var startTimeCurrentSpec = new _Date().getTime()
|
||||
|
||||
function handleGlobalErrors (result) {
|
||||
if (result.failedExpectations && result.failedExpectations.length) {
|
||||
var message = 'An error was thrown in afterAll'
|
||||
var steps = result.failedExpectations
|
||||
for (var i = 0, l = steps.length; i < l; i++) {
|
||||
message += '\n' + formatFailedStep(steps[i])
|
||||
}
|
||||
|
||||
tc.error(message)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Jasmine 2.0 dispatches the following events:
|
||||
*
|
||||
* - jasmineStarted
|
||||
* - jasmineDone
|
||||
* - suiteStarted
|
||||
* - suiteDone
|
||||
* - specStarted
|
||||
* - specDone
|
||||
*/
|
||||
|
||||
this.jasmineStarted = function (data) {
|
||||
// TODO(vojta): Do not send spec names when polling.
|
||||
tc.info({
|
||||
event: 'jasmineStarted',
|
||||
total: data.totalSpecsDefined,
|
||||
specs: getAllSpecNames(jasmineEnv.topSuite())
|
||||
})
|
||||
}
|
||||
|
||||
this.jasmineDone = function (result) {
|
||||
result = result || {}
|
||||
|
||||
// Any errors in top-level afterAll blocks are given here.
|
||||
handleGlobalErrors(result)
|
||||
|
||||
// Remove functions from called back results to avoid IPC errors in Electron
|
||||
// https://github.com/twolfson/karma-electron/issues/47
|
||||
var cleanedOrder
|
||||
if (result.order) {
|
||||
cleanedOrder = {}
|
||||
var orderKeys = Object.getOwnPropertyNames(result.order)
|
||||
for (var i = 0; i < orderKeys.length; i++) {
|
||||
var orderKey = orderKeys[i]
|
||||
if (typeof result.order[orderKey] !== 'function') {
|
||||
cleanedOrder[orderKey] = result.order[orderKey]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tc.complete({
|
||||
order: cleanedOrder,
|
||||
coverage: window.__coverage__
|
||||
})
|
||||
}
|
||||
|
||||
this.suiteStarted = function (result) {
|
||||
currentSuite = currentSuite.addChild(result.description)
|
||||
tc.info({
|
||||
event: 'suiteStarted',
|
||||
result: result
|
||||
})
|
||||
}
|
||||
|
||||
this.suiteDone = function (result) {
|
||||
// In the case of xdescribe, only "suiteDone" is fired.
|
||||
// We need to skip that.
|
||||
if (result.description !== currentSuite.name) {
|
||||
return
|
||||
}
|
||||
|
||||
// Any errors in afterAll blocks are given here, except for top-level
|
||||
// afterAll blocks.
|
||||
handleGlobalErrors(result)
|
||||
|
||||
currentSuite = currentSuite.parent
|
||||
|
||||
tc.info({
|
||||
event: 'suiteDone',
|
||||
result: result
|
||||
})
|
||||
}
|
||||
|
||||
this.specStarted = function () {
|
||||
startTimeCurrentSpec = new _Date().getTime()
|
||||
}
|
||||
|
||||
this.specDone = function (specResult) {
|
||||
var skipped = specResult.status === 'disabled' || specResult.status === 'pending' || specResult.status === 'excluded'
|
||||
var result = {
|
||||
fullName: specResult.fullName,
|
||||
description: specResult.description,
|
||||
id: specResult.id,
|
||||
log: [],
|
||||
skipped: skipped,
|
||||
disabled: specResult.status === 'disabled' || specResult.status === 'excluded',
|
||||
pending: specResult.status === 'pending',
|
||||
success: specResult.failedExpectations.length === 0,
|
||||
suite: [],
|
||||
time: skipped ? 0 : new _Date().getTime() - startTimeCurrentSpec,
|
||||
executedExpectationsCount: specResult.failedExpectations.length + specResult.passedExpectations.length,
|
||||
passedExpectations: specResult.passedExpectations,
|
||||
properties: specResult.properties
|
||||
}
|
||||
|
||||
// generate ordered list of (nested) suite names
|
||||
var suitePointer = currentSuite
|
||||
while (suitePointer.parent) {
|
||||
result.suite.unshift(suitePointer.name)
|
||||
suitePointer = suitePointer.parent
|
||||
}
|
||||
|
||||
if (!result.success) {
|
||||
var steps = specResult.failedExpectations
|
||||
for (var i = 0, l = steps.length; i < l; i++) {
|
||||
result.log.push(formatFailedStep(steps[i]))
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined' && window.location && window.location.origin) {
|
||||
// Report the name of fhe failing spec so the reporter can emit a debug url.
|
||||
result.debug_url = debugUrl(specResult.fullName)
|
||||
}
|
||||
}
|
||||
|
||||
// When failSpecWithNoExpectations is true, Jasmine will report specs without expectations as failed
|
||||
if (result.executedExpectationsCount === 0 && specResult.status === 'failed') {
|
||||
result.success = false
|
||||
result.log.push('Spec has no expectations')
|
||||
}
|
||||
|
||||
tc.result(result)
|
||||
delete specResult.startTime
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract grep option from karma config
|
||||
* @param {[Array|string]} clientArguments The karma client arguments
|
||||
* @return {string} The value of grep option by default empty string
|
||||
*/
|
||||
var getGrepOption = function (clientArguments) {
|
||||
var grepRegex = /^--grep=(.*)$/
|
||||
|
||||
if (Object.prototype.toString.call(clientArguments) === '[object Array]') {
|
||||
var indexOfGrep = indexOf(clientArguments, '--grep')
|
||||
|
||||
if (indexOfGrep !== -1) {
|
||||
return clientArguments[indexOfGrep + 1]
|
||||
}
|
||||
|
||||
return map(filter(clientArguments, function (arg) {
|
||||
return grepRegex.test(arg)
|
||||
}), function (arg) {
|
||||
return arg.replace(grepRegex, '$1')
|
||||
})[0] || ''
|
||||
} else if (typeof clientArguments === 'string') {
|
||||
var match = /--grep=([^=]+)/.exec(clientArguments)
|
||||
|
||||
return match ? match[1] : ''
|
||||
}
|
||||
}
|
||||
|
||||
var createRegExp = function (filter) {
|
||||
filter = filter || ''
|
||||
if (filter === '') {
|
||||
return new RegExp() // to match all
|
||||
}
|
||||
|
||||
var regExp = /^[/](.*)[/]([gmixXsuUAJD]*)$/ // pattern to check whether the string is RegExp pattern
|
||||
|
||||
var parts = regExp.exec(filter)
|
||||
if (parts === null) {
|
||||
return new RegExp(filter.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')) // escape functional symbols
|
||||
}
|
||||
|
||||
var patternExpression = parts[1]
|
||||
var patternSwitches = parts[2]
|
||||
return new RegExp(patternExpression, patternSwitches)
|
||||
}
|
||||
|
||||
function getGrepSpecsToRun (clientConfig, specs) {
|
||||
var grepOption = getGrepOption(clientConfig.args)
|
||||
if (grepOption) {
|
||||
var regExp = createRegExp(grepOption)
|
||||
return filter(specs, function specFilter (spec) {
|
||||
return regExp.test(spec.getFullName())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function parseQueryParams (location) {
|
||||
var params = {}
|
||||
if (location && Object.prototype.hasOwnProperty.call(location, 'search')) {
|
||||
var pairs = location.search.slice(1).split('&')
|
||||
for (var i = 0; i < pairs.length; i++) {
|
||||
var keyValue = pairs[i].split('=')
|
||||
params[decodeURIComponent(keyValue[0])] =
|
||||
decodeURIComponent(keyValue[1])
|
||||
}
|
||||
}
|
||||
return params
|
||||
}
|
||||
|
||||
function getId (s) {
|
||||
return s.id
|
||||
}
|
||||
|
||||
function getSpecsByName (specs, name) {
|
||||
specs = specs.filter(function (s) {
|
||||
return s.name.indexOf(name) !== -1
|
||||
})
|
||||
if (specs.length === 0) {
|
||||
throw new Error('No spec found with name: "' + name + '"')
|
||||
}
|
||||
return specs
|
||||
}
|
||||
|
||||
function getDebugSpecToRun (location, specs) {
|
||||
var queryParams = parseQueryParams(location)
|
||||
var spec = queryParams.spec
|
||||
if (spec) {
|
||||
// A single spec has been requested by name for debugging.
|
||||
return getSpecsByName(specs, spec)
|
||||
}
|
||||
}
|
||||
|
||||
function getSpecsToRunForCurrentShard (specs, shardIndex, totalShards) {
|
||||
if (specs.length < totalShards) {
|
||||
throw new Error(
|
||||
'More shards (' + totalShards + ') than test specs (' + specs.length +
|
||||
')')
|
||||
}
|
||||
|
||||
// Just do a simple sharding strategy of dividing the number of specs
|
||||
// equally.
|
||||
var firstSpec = Math.floor(specs.length * shardIndex / totalShards)
|
||||
var lastSpec = Math.floor(specs.length * (shardIndex + 1) / totalShards)
|
||||
return specs.slice(firstSpec, lastSpec)
|
||||
}
|
||||
|
||||
function getShardedSpecsToRun (specs, clientConfig) {
|
||||
var shardIndex = clientConfig.shardIndex
|
||||
var totalShards = clientConfig.totalShards
|
||||
if (shardIndex != null && totalShards != null) {
|
||||
// Sharded mode - Run only the subset of the specs corresponding to the
|
||||
// current shard.
|
||||
return getSpecsToRunForCurrentShard(
|
||||
specs, Number(shardIndex), Number(totalShards))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create jasmine spec filter
|
||||
* @param {Object} clientConfig karma config
|
||||
* @param {!Object} jasmineEnv
|
||||
*/
|
||||
var KarmaSpecFilter = function (clientConfig, jasmineEnv) {
|
||||
/**
|
||||
* Walk the test suite tree depth first and collect all test specs
|
||||
* @param {!Object} jasmineEnv
|
||||
* @return {!Array<string>} All possible tests.
|
||||
*/
|
||||
function getAllSpecs (jasmineEnv) {
|
||||
var specs = []
|
||||
var stack = [jasmineEnv.topSuite()]
|
||||
var currentNode
|
||||
while ((currentNode = stack.pop())) {
|
||||
if (currentNode.children) {
|
||||
// jasmine.Suite
|
||||
stack = stack.concat(currentNode.children)
|
||||
} else if (currentNode.id) {
|
||||
// jasmine.Spec
|
||||
specs.unshift(currentNode)
|
||||
}
|
||||
}
|
||||
|
||||
return specs
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the specs with URL search params and config.
|
||||
* @param {!Object} location property 'search' from URL.
|
||||
* @param {!Object} clientConfig karma client config
|
||||
* @param {!Object} jasmineEnv
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
function getSpecsToRun (location, clientConfig, jasmineEnv) {
|
||||
var specs = getAllSpecs(jasmineEnv).map(function (spec) {
|
||||
spec.name = spec.getFullName()
|
||||
return spec
|
||||
})
|
||||
|
||||
if (!specs || !specs.length) {
|
||||
return []
|
||||
}
|
||||
|
||||
return getGrepSpecsToRun(clientConfig, specs) ||
|
||||
getDebugSpecToRun(location, specs) ||
|
||||
getShardedSpecsToRun(specs, clientConfig) ||
|
||||
specs
|
||||
}
|
||||
|
||||
this.specIdsToRun = new Set(getSpecsToRun(window.location, clientConfig, jasmineEnv).map(getId))
|
||||
|
||||
this.matches = function (spec) {
|
||||
return this.specIdsToRun.has(spec.id)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure jasmine specFilter
|
||||
*
|
||||
* This function is invoked from the wrapper.
|
||||
* @see adapter.wrapper
|
||||
*
|
||||
* @param {Object} config The karma config
|
||||
* @param {Object} jasmineEnv jasmine environment object
|
||||
*/
|
||||
var createSpecFilter = function (config, jasmineEnv) {
|
||||
var karmaSpecFilter = new KarmaSpecFilter(config, jasmineEnv)
|
||||
|
||||
var originalSpecFilter = jasmineEnv.configuration().specFilter
|
||||
var specFilter = function (spec) {
|
||||
return originalSpecFilter(spec) && karmaSpecFilter.matches(spec)
|
||||
}
|
||||
|
||||
return specFilter
|
||||
}
|
||||
|
||||
/**
|
||||
* Karma starter function factory.
|
||||
*
|
||||
* This function is invoked from the wrapper.
|
||||
* @see adapter.wrapper
|
||||
*
|
||||
* @param {Object} karma Karma runner instance.
|
||||
* @param {Object} [jasmineEnv] Optional Jasmine environment for testing.
|
||||
* @return {Function} Karma starter function.
|
||||
*/
|
||||
function createStartFn (karma, jasmineEnv) {
|
||||
// This function will be assigned to `window.__karma__.start`:
|
||||
return function () {
|
||||
var clientConfig = karma.config || {}
|
||||
var jasmineConfig = clientConfig.jasmine || {}
|
||||
|
||||
jasmineEnv = jasmineEnv || window.jasmine.getEnv()
|
||||
|
||||
jasmineConfig.specFilter = createSpecFilter(clientConfig, jasmineEnv)
|
||||
jasmineEnv.configure(jasmineConfig)
|
||||
|
||||
window.jasmine.DEFAULT_TIMEOUT_INTERVAL = jasmineConfig.timeoutInterval ||
|
||||
window.jasmine.DEFAULT_TIMEOUT_INTERVAL
|
||||
jasmineEnv.addReporter(new KarmaReporter(karma, jasmineEnv))
|
||||
jasmineEnv.execute()
|
||||
}
|
||||
}
|
||||
|
||||
function indexOf (collection, find, i /* opt */) {
|
||||
if (collection.indexOf) {
|
||||
return collection.indexOf(find, i)
|
||||
}
|
||||
|
||||
if (i === undefined) { i = 0 }
|
||||
if (i < 0) { i += collection.length }
|
||||
if (i < 0) { i = 0 }
|
||||
for (var n = collection.length; i < n; i++) {
|
||||
if (i in collection && collection[i] === find) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
function filter (collection, filter, that /* opt */) {
|
||||
if (collection.filter) {
|
||||
return collection.filter(filter, that)
|
||||
}
|
||||
|
||||
var other = []
|
||||
var v
|
||||
for (var i = 0, n = collection.length; i < n; i++) {
|
||||
if (i in collection && filter.call(that, v = collection[i], i, collection)) {
|
||||
other.push(v)
|
||||
}
|
||||
}
|
||||
return other
|
||||
}
|
||||
|
||||
function map (collection, mapper, that /* opt */) {
|
||||
if (collection.map) {
|
||||
return collection.map(mapper, that)
|
||||
}
|
||||
|
||||
var other = new Array(collection.length)
|
||||
for (var i = 0, n = collection.length; i < n; i++) {
|
||||
if (i in collection) {
|
||||
other[i] = mapper.call(that, collection[i], i, collection)
|
||||
}
|
||||
}
|
||||
return other
|
||||
}
|
||||
|
||||
window.__karma__.start = createStartFn(window.__karma__)
|
||||
|
||||
})(typeof window !== 'undefined' ? window : global);
|
43
my-app/node_modules/karma-jasmine/lib/boot.js
generated
vendored
Executable file
43
my-app/node_modules/karma-jasmine/lib/boot.js
generated
vendored
Executable file
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* Jasmine 2.0 standalone `boot.js` modified for Karma.
|
||||
* This file is registered in `index.js`. This version
|
||||
* does not include `HtmlReporter` setup.
|
||||
*/
|
||||
;(function (global) {
|
||||
/* global jasmineRequire */
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Require Jasmine's core files. Specifically, this requires and
|
||||
* attaches all of Jasmine's code to the `jasmine` reference.
|
||||
*/
|
||||
var jasmine = jasmineRequire.core(jasmineRequire)
|
||||
|
||||
/**
|
||||
* Obtain the public Jasmine API.
|
||||
*/
|
||||
var jasmineInterface = jasmineRequire.interface(jasmine, jasmine.getEnv())
|
||||
|
||||
/**
|
||||
* Setting up timing functions to be able to be overridden.
|
||||
* Certain browsers (Safari, IE 8, PhantomJS) require this hack.
|
||||
*/
|
||||
/* eslint-disable no-self-assign */
|
||||
global.setTimeout = global.setTimeout
|
||||
global.setInterval = global.setInterval
|
||||
global.clearTimeout = global.clearTimeout
|
||||
global.clearInterval = global.clearInterval
|
||||
/* eslint-enable no-self-assign */
|
||||
|
||||
/**
|
||||
* Add all of the Jasmine global/public interface to the proper
|
||||
* global, so a project can use the public interface directly.
|
||||
* For example, calling `describe` in specs instead of
|
||||
* `jasmine.getEnv().describe`.
|
||||
*/
|
||||
for (var property in jasmineInterface) {
|
||||
if (Object.prototype.hasOwnProperty.call(jasmineInterface, property)) {
|
||||
global[property] = jasmineInterface[property]
|
||||
}
|
||||
}
|
||||
}(typeof window !== 'undefined' ? window : global))
|
31
my-app/node_modules/karma-jasmine/lib/index.js
generated
vendored
Executable file
31
my-app/node_modules/karma-jasmine/lib/index.js
generated
vendored
Executable file
|
@ -0,0 +1,31 @@
|
|||
var path = require('path')
|
||||
|
||||
var createPattern = function (pattern) {
|
||||
return { pattern: pattern, included: true, served: true, watched: false }
|
||||
}
|
||||
|
||||
var initJasmine = function (files) {
|
||||
var jasminePath = path.dirname(require.resolve('jasmine-core'))
|
||||
files.unshift(createPattern(path.join(__dirname, '/adapter.js')))
|
||||
files.unshift(createPattern(path.join(__dirname, '/boot.js')))
|
||||
files.unshift(createPattern(jasminePath + '/jasmine-core/jasmine.js'))
|
||||
}
|
||||
|
||||
initJasmine.$inject = ['config.files']
|
||||
|
||||
function InjectKarmaJasmineReporter (singleRun) {
|
||||
return {
|
||||
onSpecComplete (browser, karmaResult) {
|
||||
if (!singleRun && karmaResult.debug_url) {
|
||||
console.log('Debug this test: ' + karmaResult.debug_url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InjectKarmaJasmineReporter.$inject = ['config.singleRun']
|
||||
|
||||
module.exports = {
|
||||
'framework:jasmine': ['factory', initJasmine],
|
||||
'reporter:karma-jasmine': ['factory', InjectKarmaJasmineReporter]
|
||||
}
|
20
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/MIT.LICENSE
generated
vendored
Executable file
20
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/MIT.LICENSE
generated
vendored
Executable file
|
@ -0,0 +1,20 @@
|
|||
Copyright (c) 2008-2019 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
61
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/README.md
generated
vendored
Executable file
61
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/README.md
generated
vendored
Executable file
|
@ -0,0 +1,61 @@
|
|||
<a name="README">[<img src="https://rawgithub.com/jasmine/jasmine/main/images/jasmine-horizontal.svg" width="400px" />](http://jasmine.github.io)</a>
|
||||
|
||||
[](https://circleci.com/gh/jasmine/jasmine)
|
||||
[](https://www.codetriage.com/jasmine/jasmine)
|
||||
|
||||
# A JavaScript Testing Framework
|
||||
|
||||
Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, [Node.js](http://nodejs.org) projects, or anywhere that JavaScript can run.
|
||||
|
||||
Upgrading from Jasmine 3.x? Check out the [upgrade guide](https://jasmine.github.io/tutorials/upgrading_to_Jasmine_4.0).
|
||||
|
||||
## Contributing
|
||||
|
||||
Please read the [contributors' guide](https://github.com/jasmine/jasmine/blob/main/.github/CONTRIBUTING.md).
|
||||
|
||||
## Installation
|
||||
|
||||
There are several different ways to install Jasmine, depending on your
|
||||
environment and how you'd like to use it. See the [Getting Started page](https://jasmine.github.io/pages/getting_started.html)
|
||||
for details.
|
||||
|
||||
## Usage
|
||||
|
||||
See the [documentation site](https://jasmine.github.io/pages/docs_home.html),
|
||||
particularly the [Your First Suite tutorial](https://jasmine.github.io/tutorials/your_first_suite)
|
||||
for information on writing specs, and [the FAQ](https://jasmine.github.io/pages/faq.html).
|
||||
|
||||
## Supported environments
|
||||
|
||||
Jasmine tests itself across popular browsers (Safari, Chrome, Firefox, and
|
||||
Microsoft Edge) as well as Node.
|
||||
|
||||
| Environment | Supported versions |
|
||||
|-------------------|--------------------|
|
||||
| Node | 12.17+, 14, 16, 18 |
|
||||
| Safari | 14-16 |
|
||||
| Chrome | Evergreen |
|
||||
| Firefox | Evergreen, 91, 102 |
|
||||
| Edge | Evergreen |
|
||||
|
||||
For evergreen browsers, each version of Jasmine is tested against the version of the browser that is available to us
|
||||
at the time of release. Other browsers, as well as older & newer versions of some supported browsers, are likely to work.
|
||||
However, Jasmine isn't tested against them and they aren't actively supported.
|
||||
|
||||
To find out what environments work with a particular Jasmine release, see the [release notes](https://github.com/jasmine/jasmine/tree/main/release_notes).
|
||||
|
||||
## Maintainers
|
||||
|
||||
* [Gwendolyn Van Hove](mailto:gwen@slackersoft.net)
|
||||
* [Steve Gravrock](mailto:sdg@panix.com)
|
||||
|
||||
### Maintainers Emeritus
|
||||
|
||||
* [Davis W. Frank](mailto:dwfrank@pivotal.io)
|
||||
* [Rajan Agaskar](mailto:rajan@pivotal.io)
|
||||
* [Greg Cobb](mailto:gcobb@pivotal.io)
|
||||
* [Chris Amavisca](mailto:camavisca@pivotal.io)
|
||||
* [Christian Williams](mailto:antixian666@gmail.com)
|
||||
* Sheel Choksi
|
||||
|
||||
Copyright (c) 2008-2022 Jasmine Maintainers. This software is licensed under the [MIT License](https://github.com/jasmine/jasmine/blob/main/MIT.LICENSE).
|
BIN
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/images/jasmine-horizontal.png
generated
vendored
Executable file
BIN
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/images/jasmine-horizontal.png
generated
vendored
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
102
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/images/jasmine-horizontal.svg
generated
vendored
Executable file
102
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/images/jasmine-horizontal.svg
generated
vendored
Executable file
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
width="681.96252"
|
||||
height="187.5"
|
||||
id="svg2"
|
||||
xml:space="preserve"><metadata
|
||||
id="metadata8"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs6"><clipPath
|
||||
id="clipPath18"><path
|
||||
d="M 0,1500 0,0 l 5455.74,0 0,1500 L 0,1500 z"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path20" /></clipPath></defs><g
|
||||
transform="matrix(1.25,0,0,-1.25,0,187.5)"
|
||||
id="g10"><g
|
||||
transform="scale(0.1,0.1)"
|
||||
id="g12"><g
|
||||
id="g14"><g
|
||||
clip-path="url(#clipPath18)"
|
||||
id="g16"><path
|
||||
d="m 1544,599.434 c 0.92,-40.352 25.68,-81.602 71.53,-81.602 27.51,0 47.68,12.832 61.44,35.754 12.83,22.93 12.83,56.852 12.83,82.527 l 0,329.184 -71.52,0 0,104.543 266.83,0 0,-104.543 -70.6,0 0,-344.77 c 0,-58.691 -3.68,-104.531 -44.93,-152.218 -36.68,-42.18 -96.28,-66.02 -153.14,-66.02 -117.37,0 -207.24,77.941 -202.64,197.145 l 130.2,0"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path22"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 2301.4,662.695 c 0,80.703 -66.94,145.813 -147.63,145.813 -83.44,0 -147.63,-68.781 -147.63,-151.301 0,-79.785 66.94,-145.801 145.8,-145.801 84.35,0 149.46,67.852 149.46,151.289 z m -1.83,-181.547 c -35.77,-54.097 -93.53,-78.859 -157.72,-78.859 -140.3,0 -251.24,116.449 -251.24,254.918 0,142.129 113.7,260.41 256.74,260.41 63.27,0 118.29,-29.336 152.22,-82.523 l 0,69.687 175.14,0 0,-104.527 -61.44,0 0,-280.598 61.44,0 0,-104.527 -175.14,0 0,66.019"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path24"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 2622.33,557.258 c 3.67,-44.016 33.01,-73.348 78.86,-73.348 33.93,0 66.93,23.824 66.93,60.504 0,48.606 -45.84,56.856 -83.44,66.941 -85.28,22.004 -178.81,48.606 -178.81,155.879 0,93.536 78.86,147.633 165.98,147.633 44,0 83.43,-9.176 110.94,-44.008 l 0,33.922 82.53,0 0,-132.965 -108.21,0 c -1.83,34.856 -28.42,57.774 -63.26,57.774 -30.26,0 -62.35,-17.422 -62.35,-51.348 0,-45.847 44.93,-55.93 80.69,-64.18 88.02,-20.175 182.47,-47.695 182.47,-157.734 0,-99.027 -83.44,-154.039 -175.13,-154.039 -49.53,0 -94.46,15.582 -126.55,53.18 l 0,-40.34 -85.27,0 0,142.129 114.62,0"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path26"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 2988.18,800.254 -63.26,0 0,104.527 165.05,0 0,-73.355 c 31.18,51.347 78.86,85.277 141.21,85.277 67.85,0 124.71,-41.258 152.21,-102.699 26.6,62.351 92.62,102.699 160.47,102.699 53.19,0 105.46,-22 141.21,-62.351 38.52,-44.938 38.52,-93.532 38.52,-149.457 l 0,-185.239 63.27,0 0,-104.527 -238.42,0 0,104.527 63.28,0 0,157.715 c 0,32.102 0,60.527 -14.67,88.957 -18.34,26.582 -48.61,40.344 -79.77,40.344 -30.26,0 -63.28,-12.844 -82.53,-36.672 -22.93,-29.355 -22.93,-56.863 -22.93,-92.629 l 0,-157.715 63.27,0 0,-104.527 -238.41,0 0,104.527 63.28,0 0,150.383 c 0,29.348 0,66.023 -14.67,91.699 -15.59,29.336 -47.69,44.934 -80.7,44.934 -31.18,0 -57.77,-11.008 -77.94,-35.774 -24.77,-30.253 -26.6,-62.343 -26.6,-99.941 l 0,-151.301 63.27,0 0,-104.527 -238.4,0 0,104.527 63.26,0 0,280.598"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path28"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 3998.66,951.547 -111.87,0 0,118.293 111.87,0 0,-118.293 z m 0,-431.891 63.27,0 0,-104.527 -239.33,0 0,104.527 64.19,0 0,280.598 -63.27,0 0,104.527 175.14,0 0,-385.125"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path30"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 4159.12,800.254 -63.27,0 0,104.527 175.14,0 0,-69.687 c 29.35,54.101 84.36,80.699 144.87,80.699 53.19,0 105.45,-22.016 141.22,-60.527 40.34,-44.934 41.26,-88.032 41.26,-143.957 l 0,-191.653 63.27,0 0,-104.527 -238.4,0 0,104.527 63.26,0 0,158.637 c 0,30.262 0,61.434 -19.26,88.035 -20.17,26.582 -53.18,39.414 -86.19,39.414 -33.93,0 -68.77,-13.75 -88.94,-41.25 -21.09,-27.5 -21.09,-69.687 -21.09,-102.707 l 0,-142.129 63.26,0 0,-104.527 -238.4,0 0,104.527 63.27,0 0,280.598"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path32"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 5082.48,703.965 c -19.24,70.605 -81.6,115.547 -154.04,115.547 -66.04,0 -129.3,-51.348 -143.05,-115.547 l 297.09,0 z m 85.27,-144.883 c -38.51,-93.523 -129.27,-156.793 -231.05,-156.793 -143.07,0 -257.68,111.871 -257.68,255.836 0,144.883 109.12,261.328 254.91,261.328 67.87,0 135.72,-30.258 183.39,-78.863 48.62,-51.344 68.79,-113.695 68.79,-183.383 l -3.67,-39.434 -396.13,0 c 14.67,-67.863 77.03,-117.363 146.72,-117.363 48.59,0 90.76,18.328 118.28,58.672 l 116.44,0"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path34"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 690.895,850.703 90.75,0 22.543,31.035 0,243.122 -135.829,0 0,-243.141 22.536,-31.016"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path36"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 632.395,742.258 28.039,86.304 -22.551,31.04 -231.223,75.128 -41.976,-129.183 231.257,-75.137 36.454,11.848"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path38"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 717.449,653.105 -73.41,53.36 -36.488,-11.875 -142.903,-196.692 109.883,-79.828 142.918,196.703 0,38.332"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path40"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 828.52,706.465 -73.426,-53.34 0.011,-38.359 L 898.004,418.07 1007.9,497.898 864.973,694.609 828.52,706.465"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path42"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 812.086,828.586 28.055,-86.32 36.484,-11.836 231.225,75.117 -41.97,129.183 -231.239,-75.14 -22.555,-31.004"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path44"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 736.301,1335.88 c -323.047,0 -585.875,-262.78 -585.875,-585.782 0,-323.118 262.828,-585.977 585.875,-585.977 323.019,0 585.809,262.859 585.809,585.977 0,323.002 -262.79,585.782 -585.809,585.782 l 0,0 z m 0,-118.61 c 257.972,0 467.189,-209.13 467.189,-467.172 0,-258.129 -209.217,-467.348 -467.189,-467.348 -258.074,0 -467.254,209.219 -467.254,467.348 0,258.042 209.18,467.172 467.254,467.172"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path46"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 1091.13,619.883 -175.771,57.121 11.629,35.808 175.762,-57.121 -11.62,-35.808"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path48"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="M 866.957,902.074 836.5,924.199 945.121,1073.73 975.586,1051.61 866.957,902.074"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path50"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="M 607.465,903.445 498.855,1052.97 529.32,1075.1 637.93,925.566 607.465,903.445"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path52"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 380.688,622.129 -11.626,35.801 175.758,57.09 11.621,-35.801 -175.753,-57.09"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path54"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /><path
|
||||
d="m 716.289,376.59 37.6406,0 0,184.816 -37.6406,0 0,-184.816 z"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path56"
|
||||
style="fill:#8a4182;fill-opacity:1;fill-rule:nonzero;stroke:none" /></g></g></g></g></svg>
|
After Width: | Height: | Size: 8.6 KiB |
BIN
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/images/jasmine_favicon.png
generated
vendored
Executable file
BIN
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/images/jasmine_favicon.png
generated
vendored
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
74
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core.js
generated
vendored
Executable file
74
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core.js
generated
vendored
Executable file
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* Note: Only available on Node.
|
||||
* @module jasmine-core
|
||||
*/
|
||||
|
||||
const jasmineRequire = require('./jasmine-core/jasmine.js');
|
||||
module.exports = jasmineRequire;
|
||||
|
||||
/**
|
||||
* Boots a copy of Jasmine and returns an object as described in {@link jasmine}.
|
||||
* @type {function}
|
||||
* @return {jasmine}
|
||||
*/
|
||||
module.exports.boot = require('./jasmine-core/node_boot.js');
|
||||
|
||||
/**
|
||||
* Boots a copy of Jasmine and returns an object containing the properties
|
||||
* that would normally be added to the global object. If noGlobals is called
|
||||
* multiple times, the same object is returned every time.
|
||||
*
|
||||
* Do not call boot() if you also call noGlobals().
|
||||
*
|
||||
* @example
|
||||
* const {describe, beforeEach, it, expect, jasmine} = require('jasmine-core').noGlobals();
|
||||
*/
|
||||
module.exports.noGlobals = (function() {
|
||||
let jasmineInterface;
|
||||
|
||||
return function bootWithoutGlobals() {
|
||||
if (!jasmineInterface) {
|
||||
const jasmine = jasmineRequire.core(jasmineRequire);
|
||||
const env = jasmine.getEnv({ suppressLoadErrors: true });
|
||||
jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
}
|
||||
|
||||
return jasmineInterface;
|
||||
};
|
||||
}());
|
||||
|
||||
const path = require('path'),
|
||||
fs = require('fs');
|
||||
|
||||
const rootPath = path.join(__dirname, 'jasmine-core'),
|
||||
bootFiles = ['boot0.js', 'boot1.js'],
|
||||
legacyBootFiles = ['boot.js'],
|
||||
nodeBootFiles = ['node_boot.js'],
|
||||
cssFiles = [],
|
||||
jsFiles = [],
|
||||
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, legacyBootFiles, nodeBootFiles);
|
||||
|
||||
fs.readdirSync(rootPath).forEach(function(file) {
|
||||
if(fs.statSync(path.join(rootPath, file)).isFile()) {
|
||||
switch(path.extname(file)) {
|
||||
case '.css':
|
||||
cssFiles.push(file);
|
||||
break;
|
||||
case '.js':
|
||||
if (jsFilesToSkip.indexOf(file) < 0) {
|
||||
jsFiles.push(file);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.exports.files = {
|
||||
path: rootPath,
|
||||
bootDir: rootPath,
|
||||
bootFiles: bootFiles,
|
||||
nodeBootFiles: nodeBootFiles,
|
||||
cssFiles: cssFiles,
|
||||
jsFiles: ['jasmine.js'].concat(jsFiles),
|
||||
imagesDir: path.join(__dirname, '../images')
|
||||
};
|
64
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/boot0.js
generated
vendored
Executable file
64
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/boot0.js
generated
vendored
Executable file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
Copyright (c) 2008-2023 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
This file starts the process of "booting" Jasmine. It initializes Jasmine,
|
||||
makes its globals available, and creates the env. This file should be loaded
|
||||
after `jasmine.js` and `jasmine_html.js`, but before `boot1.js` or any project
|
||||
source files or spec files are loaded.
|
||||
*/
|
||||
(function() {
|
||||
const jasmineRequire = window.jasmineRequire || require('./jasmine.js');
|
||||
|
||||
/**
|
||||
* ## Require & Instantiate
|
||||
*
|
||||
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
|
||||
*/
|
||||
const jasmine = jasmineRequire.core(jasmineRequire),
|
||||
global = jasmine.getGlobal();
|
||||
global.jasmine = jasmine;
|
||||
|
||||
/**
|
||||
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
|
||||
*/
|
||||
jasmineRequire.html(jasmine);
|
||||
|
||||
/**
|
||||
* Create the Jasmine environment. This is used to run all specs in a project.
|
||||
*/
|
||||
const env = jasmine.getEnv();
|
||||
|
||||
/**
|
||||
* ## The Global Interface
|
||||
*
|
||||
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
|
||||
*/
|
||||
const jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
/**
|
||||
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
|
||||
*/
|
||||
for (const property in jasmineInterface) {
|
||||
global[property] = jasmineInterface[property];
|
||||
}
|
||||
})();
|
132
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/boot1.js
generated
vendored
Executable file
132
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/boot1.js
generated
vendored
Executable file
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
Copyright (c) 2008-2023 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/**
|
||||
This file finishes 'booting' Jasmine, performing all of the necessary
|
||||
initialization before executing the loaded environment and all of a project's
|
||||
specs. This file should be loaded after `boot0.js` but before any project
|
||||
source files or spec files are loaded. Thus this file can also be used to
|
||||
customize Jasmine for a project.
|
||||
|
||||
If a project is using Jasmine via the standalone distribution, this file can
|
||||
be customized directly. If you only wish to configure the Jasmine env, you
|
||||
can load another file that calls `jasmine.getEnv().configure({...})`
|
||||
after `boot0.js` is loaded and before this file is loaded.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
const env = jasmine.getEnv();
|
||||
|
||||
/**
|
||||
* ## Runner Parameters
|
||||
*
|
||||
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
|
||||
*/
|
||||
|
||||
const queryString = new jasmine.QueryString({
|
||||
getWindowLocation: function() {
|
||||
return window.location;
|
||||
}
|
||||
});
|
||||
|
||||
const filterSpecs = !!queryString.getParam('spec');
|
||||
|
||||
const config = {
|
||||
stopOnSpecFailure: queryString.getParam('stopOnSpecFailure'),
|
||||
stopSpecOnExpectationFailure: queryString.getParam(
|
||||
'stopSpecOnExpectationFailure'
|
||||
),
|
||||
hideDisabled: queryString.getParam('hideDisabled')
|
||||
};
|
||||
|
||||
const random = queryString.getParam('random');
|
||||
|
||||
if (random !== undefined && random !== '') {
|
||||
config.random = random;
|
||||
}
|
||||
|
||||
const seed = queryString.getParam('seed');
|
||||
if (seed) {
|
||||
config.seed = seed;
|
||||
}
|
||||
|
||||
/**
|
||||
* ## Reporters
|
||||
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
|
||||
*/
|
||||
const htmlReporter = new jasmine.HtmlReporter({
|
||||
env: env,
|
||||
navigateWithNewParam: function(key, value) {
|
||||
return queryString.navigateWithNewParam(key, value);
|
||||
},
|
||||
addToExistingQueryString: function(key, value) {
|
||||
return queryString.fullStringWithNewParam(key, value);
|
||||
},
|
||||
getContainer: function() {
|
||||
return document.body;
|
||||
},
|
||||
createElement: function() {
|
||||
return document.createElement.apply(document, arguments);
|
||||
},
|
||||
createTextNode: function() {
|
||||
return document.createTextNode.apply(document, arguments);
|
||||
},
|
||||
timer: new jasmine.Timer(),
|
||||
filterSpecs: filterSpecs
|
||||
});
|
||||
|
||||
/**
|
||||
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
|
||||
*/
|
||||
env.addReporter(jsApiReporter);
|
||||
env.addReporter(htmlReporter);
|
||||
|
||||
/**
|
||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
||||
*/
|
||||
const specFilter = new jasmine.HtmlSpecFilter({
|
||||
filterString: function() {
|
||||
return queryString.getParam('spec');
|
||||
}
|
||||
});
|
||||
|
||||
config.specFilter = function(spec) {
|
||||
return specFilter.matches(spec.getFullName());
|
||||
};
|
||||
|
||||
env.configure(config);
|
||||
|
||||
/**
|
||||
* ## Execution
|
||||
*
|
||||
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
|
||||
*/
|
||||
const currentWindowOnload = window.onload;
|
||||
|
||||
window.onload = function() {
|
||||
if (currentWindowOnload) {
|
||||
currentWindowOnload();
|
||||
}
|
||||
htmlReporter.initialize();
|
||||
env.execute();
|
||||
};
|
||||
})();
|
24
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/lib/jasmine_examples/Player.js
generated
vendored
Executable file
24
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/lib/jasmine_examples/Player.js
generated
vendored
Executable file
|
@ -0,0 +1,24 @@
|
|||
class Player {
|
||||
play(song) {
|
||||
this.currentlyPlayingSong = song;
|
||||
this.isPlaying = true;
|
||||
}
|
||||
|
||||
pause() {
|
||||
this.isPlaying = false;
|
||||
}
|
||||
|
||||
resume() {
|
||||
if (this.isPlaying) {
|
||||
throw new Error('song is already playing');
|
||||
}
|
||||
|
||||
this.isPlaying = true;
|
||||
}
|
||||
|
||||
makeFavorite() {
|
||||
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Player;
|
8
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/lib/jasmine_examples/Song.js
generated
vendored
Executable file
8
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/lib/jasmine_examples/Song.js
generated
vendored
Executable file
|
@ -0,0 +1,8 @@
|
|||
class Song {
|
||||
persistFavoriteStatus(value) {
|
||||
// something complicated
|
||||
throw new Error('not yet implemented');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Song;
|
15
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/spec/helpers/jasmine_examples/SpecHelper.js
generated
vendored
Executable file
15
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/spec/helpers/jasmine_examples/SpecHelper.js
generated
vendored
Executable file
|
@ -0,0 +1,15 @@
|
|||
beforeEach(function () {
|
||||
jasmine.addMatchers({
|
||||
toBePlaying: function () {
|
||||
return {
|
||||
compare: function (actual, expected) {
|
||||
const player = actual;
|
||||
|
||||
return {
|
||||
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
61
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/spec/jasmine_examples/PlayerSpec.js
generated
vendored
Executable file
61
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/node_example/spec/jasmine_examples/PlayerSpec.js
generated
vendored
Executable file
|
@ -0,0 +1,61 @@
|
|||
const Player = require('../../lib/jasmine_examples/Player');
|
||||
const Song = require('../../lib/jasmine_examples/Song');
|
||||
|
||||
describe('Player', function() {
|
||||
let player;
|
||||
let song;
|
||||
|
||||
beforeEach(function() {
|
||||
player = new Player();
|
||||
song = new Song();
|
||||
});
|
||||
|
||||
it('should be able to play a Song', function() {
|
||||
player.play(song);
|
||||
expect(player.currentlyPlayingSong).toEqual(song);
|
||||
|
||||
// demonstrates use of custom matcher
|
||||
expect(player).toBePlaying(song);
|
||||
});
|
||||
|
||||
describe('when song has been paused', function() {
|
||||
beforeEach(function() {
|
||||
player.play(song);
|
||||
player.pause();
|
||||
});
|
||||
|
||||
it('should indicate that the song is currently paused', function() {
|
||||
expect(player.isPlaying).toBeFalsy();
|
||||
|
||||
// demonstrates use of 'not' with a custom matcher
|
||||
expect(player).not.toBePlaying(song);
|
||||
});
|
||||
|
||||
it('should be possible to resume', function() {
|
||||
player.resume();
|
||||
expect(player.isPlaying).toBeTruthy();
|
||||
expect(player.currentlyPlayingSong).toEqual(song);
|
||||
});
|
||||
});
|
||||
|
||||
// demonstrates use of spies to intercept and test method calls
|
||||
it('tells the current song if the user has made it a favorite', function() {
|
||||
spyOn(song, 'persistFavoriteStatus');
|
||||
|
||||
player.play(song);
|
||||
player.makeFavorite();
|
||||
|
||||
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
//demonstrates use of expected exceptions
|
||||
describe('#resume', function() {
|
||||
it('should throw an exception if song is already playing', function() {
|
||||
player.play(song);
|
||||
|
||||
expect(function() {
|
||||
player.resume();
|
||||
}).toThrowError('song is already playing');
|
||||
});
|
||||
});
|
||||
});
|
58
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/spec/PlayerSpec.js
generated
vendored
Executable file
58
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/spec/PlayerSpec.js
generated
vendored
Executable file
|
@ -0,0 +1,58 @@
|
|||
describe('Player', function() {
|
||||
let player;
|
||||
let song;
|
||||
|
||||
beforeEach(function() {
|
||||
player = new Player();
|
||||
song = new Song();
|
||||
});
|
||||
|
||||
it('should be able to play a Song', function() {
|
||||
player.play(song);
|
||||
expect(player.currentlyPlayingSong).toEqual(song);
|
||||
|
||||
// demonstrates use of custom matcher
|
||||
expect(player).toBePlaying(song);
|
||||
});
|
||||
|
||||
describe('when song has been paused', function() {
|
||||
beforeEach(function() {
|
||||
player.play(song);
|
||||
player.pause();
|
||||
});
|
||||
|
||||
it('should indicate that the song is currently paused', function() {
|
||||
expect(player.isPlaying).toBeFalsy();
|
||||
|
||||
// demonstrates use of 'not' with a custom matcher
|
||||
expect(player).not.toBePlaying(song);
|
||||
});
|
||||
|
||||
it('should be possible to resume', function() {
|
||||
player.resume();
|
||||
expect(player.isPlaying).toBeTruthy();
|
||||
expect(player.currentlyPlayingSong).toEqual(song);
|
||||
});
|
||||
});
|
||||
|
||||
// demonstrates use of spies to intercept and test method calls
|
||||
it('tells the current song if the user has made it a favorite', function() {
|
||||
spyOn(song, 'persistFavoriteStatus');
|
||||
|
||||
player.play(song);
|
||||
player.makeFavorite();
|
||||
|
||||
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
//demonstrates use of expected exceptions
|
||||
describe('#resume', function() {
|
||||
it('should throw an exception if song is already playing', function() {
|
||||
player.play(song);
|
||||
|
||||
expect(function() {
|
||||
player.resume();
|
||||
}).toThrowError('song is already playing');
|
||||
});
|
||||
});
|
||||
});
|
15
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/spec/SpecHelper.js
generated
vendored
Executable file
15
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/spec/SpecHelper.js
generated
vendored
Executable file
|
@ -0,0 +1,15 @@
|
|||
beforeEach(function () {
|
||||
jasmine.addMatchers({
|
||||
toBePlaying: function () {
|
||||
return {
|
||||
compare: function (actual, expected) {
|
||||
const player = actual;
|
||||
|
||||
return {
|
||||
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
});
|
22
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/src/Player.js
generated
vendored
Executable file
22
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/src/Player.js
generated
vendored
Executable file
|
@ -0,0 +1,22 @@
|
|||
class Player {
|
||||
play(song) {
|
||||
this.currentlyPlayingSong = song;
|
||||
this.isPlaying = true;
|
||||
}
|
||||
|
||||
pause() {
|
||||
this.isPlaying = false;
|
||||
}
|
||||
|
||||
resume() {
|
||||
if (this.isPlaying) {
|
||||
throw new Error('song is already playing');
|
||||
}
|
||||
|
||||
this.isPlaying = true;
|
||||
}
|
||||
|
||||
makeFavorite() {
|
||||
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
||||
}
|
||||
}
|
6
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/src/Song.js
generated
vendored
Executable file
6
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/example/src/Song.js
generated
vendored
Executable file
|
@ -0,0 +1,6 @@
|
|||
class Song {
|
||||
persistFavoriteStatus(value) {
|
||||
// something complicated
|
||||
throw new Error('not yet implemented');
|
||||
}
|
||||
}
|
964
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js
generated
vendored
Executable file
964
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js
generated
vendored
Executable file
|
@ -0,0 +1,964 @@
|
|||
/*
|
||||
Copyright (c) 2008-2023 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
// eslint-disable-next-line no-var
|
||||
var jasmineRequire = window.jasmineRequire || require('./jasmine.js');
|
||||
|
||||
jasmineRequire.html = function(j$) {
|
||||
j$.ResultsNode = jasmineRequire.ResultsNode();
|
||||
j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
|
||||
j$.QueryString = jasmineRequire.QueryString();
|
||||
j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
|
||||
};
|
||||
|
||||
jasmineRequire.HtmlReporter = function(j$) {
|
||||
function ResultsStateBuilder() {
|
||||
this.topResults = new j$.ResultsNode({}, '', null);
|
||||
this.currentParent = this.topResults;
|
||||
this.specsExecuted = 0;
|
||||
this.failureCount = 0;
|
||||
this.pendingSpecCount = 0;
|
||||
}
|
||||
|
||||
ResultsStateBuilder.prototype.suiteStarted = function(result) {
|
||||
this.currentParent.addChild(result, 'suite');
|
||||
this.currentParent = this.currentParent.last();
|
||||
};
|
||||
|
||||
ResultsStateBuilder.prototype.suiteDone = function(result) {
|
||||
this.currentParent.updateResult(result);
|
||||
if (this.currentParent !== this.topResults) {
|
||||
this.currentParent = this.currentParent.parent;
|
||||
}
|
||||
|
||||
if (result.status === 'failed') {
|
||||
this.failureCount++;
|
||||
}
|
||||
};
|
||||
|
||||
ResultsStateBuilder.prototype.specStarted = function(result) {};
|
||||
|
||||
ResultsStateBuilder.prototype.specDone = function(result) {
|
||||
this.currentParent.addChild(result, 'spec');
|
||||
|
||||
if (result.status !== 'excluded') {
|
||||
this.specsExecuted++;
|
||||
}
|
||||
|
||||
if (result.status === 'failed') {
|
||||
this.failureCount++;
|
||||
}
|
||||
|
||||
if (result.status == 'pending') {
|
||||
this.pendingSpecCount++;
|
||||
}
|
||||
};
|
||||
|
||||
ResultsStateBuilder.prototype.jasmineDone = function(result) {
|
||||
if (result.failedExpectations) {
|
||||
this.failureCount += result.failedExpectations.length;
|
||||
}
|
||||
};
|
||||
|
||||
function HtmlReporter(options) {
|
||||
function config() {
|
||||
return (options.env && options.env.configuration()) || {};
|
||||
}
|
||||
|
||||
const getContainer = options.getContainer;
|
||||
const createElement = options.createElement;
|
||||
const createTextNode = options.createTextNode;
|
||||
const navigateWithNewParam = options.navigateWithNewParam || function() {};
|
||||
const addToExistingQueryString =
|
||||
options.addToExistingQueryString || defaultQueryString;
|
||||
const filterSpecs = options.filterSpecs;
|
||||
let htmlReporterMain;
|
||||
let symbols;
|
||||
const deprecationWarnings = [];
|
||||
const failures = [];
|
||||
|
||||
this.initialize = function() {
|
||||
clearPrior();
|
||||
htmlReporterMain = createDom(
|
||||
'div',
|
||||
{ className: 'jasmine_html-reporter' },
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-banner' },
|
||||
createDom('a', {
|
||||
className: 'jasmine-title',
|
||||
href: 'http://jasmine.github.io/',
|
||||
target: '_blank'
|
||||
}),
|
||||
createDom('span', { className: 'jasmine-version' }, j$.version)
|
||||
),
|
||||
createDom('ul', { className: 'jasmine-symbol-summary' }),
|
||||
createDom('div', { className: 'jasmine-alert' }),
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-results' },
|
||||
createDom('div', { className: 'jasmine-failures' })
|
||||
)
|
||||
);
|
||||
getContainer().appendChild(htmlReporterMain);
|
||||
};
|
||||
|
||||
let totalSpecsDefined;
|
||||
this.jasmineStarted = function(options) {
|
||||
totalSpecsDefined = options.totalSpecsDefined || 0;
|
||||
};
|
||||
|
||||
const summary = createDom('div', { className: 'jasmine-summary' });
|
||||
|
||||
const stateBuilder = new ResultsStateBuilder();
|
||||
|
||||
this.suiteStarted = function(result) {
|
||||
stateBuilder.suiteStarted(result);
|
||||
};
|
||||
|
||||
this.suiteDone = function(result) {
|
||||
stateBuilder.suiteDone(result);
|
||||
|
||||
if (result.status === 'failed') {
|
||||
failures.push(failureDom(result));
|
||||
}
|
||||
addDeprecationWarnings(result, 'suite');
|
||||
};
|
||||
|
||||
this.specStarted = function(result) {
|
||||
stateBuilder.specStarted(result);
|
||||
};
|
||||
|
||||
this.specDone = function(result) {
|
||||
stateBuilder.specDone(result);
|
||||
|
||||
if (noExpectations(result)) {
|
||||
const noSpecMsg = "Spec '" + result.fullName + "' has no expectations.";
|
||||
if (result.status === 'failed') {
|
||||
console.error(noSpecMsg);
|
||||
} else {
|
||||
console.warn(noSpecMsg);
|
||||
}
|
||||
}
|
||||
|
||||
if (!symbols) {
|
||||
symbols = find('.jasmine-symbol-summary');
|
||||
}
|
||||
|
||||
symbols.appendChild(
|
||||
createDom('li', {
|
||||
className: this.displaySpecInCorrectFormat(result),
|
||||
id: 'spec_' + result.id,
|
||||
title: result.fullName
|
||||
})
|
||||
);
|
||||
|
||||
if (result.status === 'failed') {
|
||||
failures.push(failureDom(result));
|
||||
}
|
||||
|
||||
addDeprecationWarnings(result, 'spec');
|
||||
};
|
||||
|
||||
this.displaySpecInCorrectFormat = function(result) {
|
||||
return noExpectations(result) && result.status === 'passed'
|
||||
? 'jasmine-empty'
|
||||
: this.resultStatus(result.status);
|
||||
};
|
||||
|
||||
this.resultStatus = function(status) {
|
||||
if (status === 'excluded') {
|
||||
return config().hideDisabled
|
||||
? 'jasmine-excluded-no-display'
|
||||
: 'jasmine-excluded';
|
||||
}
|
||||
return 'jasmine-' + status;
|
||||
};
|
||||
|
||||
this.jasmineDone = function(doneResult) {
|
||||
stateBuilder.jasmineDone(doneResult);
|
||||
const banner = find('.jasmine-banner');
|
||||
const alert = find('.jasmine-alert');
|
||||
const order = doneResult && doneResult.order;
|
||||
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-duration' },
|
||||
'finished in ' + doneResult.totalTime / 1000 + 's'
|
||||
)
|
||||
);
|
||||
|
||||
banner.appendChild(optionsMenu(config()));
|
||||
|
||||
if (stateBuilder.specsExecuted < totalSpecsDefined) {
|
||||
const skippedMessage =
|
||||
'Ran ' +
|
||||
stateBuilder.specsExecuted +
|
||||
' of ' +
|
||||
totalSpecsDefined +
|
||||
' specs - run all';
|
||||
// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
|
||||
const skippedLink =
|
||||
(window.location.pathname || '') +
|
||||
addToExistingQueryString('spec', '');
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-bar jasmine-skipped' },
|
||||
createDom(
|
||||
'a',
|
||||
{ href: skippedLink, title: 'Run all specs' },
|
||||
skippedMessage
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
let statusBarMessage = '';
|
||||
let statusBarClassName = 'jasmine-overall-result jasmine-bar ';
|
||||
const globalFailures =
|
||||
(doneResult && doneResult.failedExpectations) || [];
|
||||
const failed = stateBuilder.failureCount + globalFailures.length > 0;
|
||||
|
||||
if (totalSpecsDefined > 0 || failed) {
|
||||
statusBarMessage +=
|
||||
pluralize('spec', stateBuilder.specsExecuted) +
|
||||
', ' +
|
||||
pluralize('failure', stateBuilder.failureCount);
|
||||
if (stateBuilder.pendingSpecCount) {
|
||||
statusBarMessage +=
|
||||
', ' + pluralize('pending spec', stateBuilder.pendingSpecCount);
|
||||
}
|
||||
}
|
||||
|
||||
if (doneResult.overallStatus === 'passed') {
|
||||
statusBarClassName += ' jasmine-passed ';
|
||||
} else if (doneResult.overallStatus === 'incomplete') {
|
||||
statusBarClassName += ' jasmine-incomplete ';
|
||||
statusBarMessage =
|
||||
'Incomplete: ' +
|
||||
doneResult.incompleteReason +
|
||||
', ' +
|
||||
statusBarMessage;
|
||||
} else {
|
||||
statusBarClassName += ' jasmine-failed ';
|
||||
}
|
||||
|
||||
let seedBar;
|
||||
if (order && order.random) {
|
||||
seedBar = createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-seed-bar' },
|
||||
', randomized with seed ',
|
||||
createDom(
|
||||
'a',
|
||||
{
|
||||
title: 'randomized with seed ' + order.seed,
|
||||
href: seedHref(order.seed)
|
||||
},
|
||||
order.seed
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: statusBarClassName },
|
||||
statusBarMessage,
|
||||
seedBar
|
||||
)
|
||||
);
|
||||
|
||||
const errorBarClassName = 'jasmine-bar jasmine-errored';
|
||||
const afterAllMessagePrefix = 'AfterAll ';
|
||||
|
||||
for (let i = 0; i < globalFailures.length; i++) {
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: errorBarClassName },
|
||||
globalFailureMessage(globalFailures[i])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function globalFailureMessage(failure) {
|
||||
if (failure.globalErrorType === 'load') {
|
||||
const prefix = 'Error during loading: ' + failure.message;
|
||||
|
||||
if (failure.filename) {
|
||||
return (
|
||||
prefix + ' in ' + failure.filename + ' line ' + failure.lineno
|
||||
);
|
||||
} else {
|
||||
return prefix;
|
||||
}
|
||||
} else if (failure.globalErrorType === 'afterAll') {
|
||||
return afterAllMessagePrefix + failure.message;
|
||||
} else {
|
||||
return failure.message;
|
||||
}
|
||||
}
|
||||
|
||||
addDeprecationWarnings(doneResult);
|
||||
|
||||
for (let i = 0; i < deprecationWarnings.length; i++) {
|
||||
const children = [];
|
||||
let context;
|
||||
|
||||
switch (deprecationWarnings[i].runnableType) {
|
||||
case 'spec':
|
||||
context = '(in spec: ' + deprecationWarnings[i].runnableName + ')';
|
||||
break;
|
||||
case 'suite':
|
||||
context = '(in suite: ' + deprecationWarnings[i].runnableName + ')';
|
||||
break;
|
||||
default:
|
||||
context = '';
|
||||
}
|
||||
|
||||
deprecationWarnings[i].message.split('\n').forEach(function(line) {
|
||||
children.push(line);
|
||||
children.push(createDom('br'));
|
||||
});
|
||||
|
||||
children[0] = 'DEPRECATION: ' + children[0];
|
||||
children.push(context);
|
||||
|
||||
if (deprecationWarnings[i].stack) {
|
||||
children.push(createExpander(deprecationWarnings[i].stack));
|
||||
}
|
||||
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-bar jasmine-warning' },
|
||||
children
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const results = find('.jasmine-results');
|
||||
results.appendChild(summary);
|
||||
|
||||
summaryList(stateBuilder.topResults, summary);
|
||||
|
||||
if (failures.length) {
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-menu jasmine-bar jasmine-spec-list' },
|
||||
createDom('span', {}, 'Spec List | '),
|
||||
createDom(
|
||||
'a',
|
||||
{ className: 'jasmine-failures-menu', href: '#' },
|
||||
'Failures'
|
||||
)
|
||||
)
|
||||
);
|
||||
alert.appendChild(
|
||||
createDom(
|
||||
'span',
|
||||
{ className: 'jasmine-menu jasmine-bar jasmine-failure-list' },
|
||||
createDom(
|
||||
'a',
|
||||
{ className: 'jasmine-spec-list-menu', href: '#' },
|
||||
'Spec List'
|
||||
),
|
||||
createDom('span', {}, ' | Failures ')
|
||||
)
|
||||
);
|
||||
|
||||
find('.jasmine-failures-menu').onclick = function() {
|
||||
setMenuModeTo('jasmine-failure-list');
|
||||
return false;
|
||||
};
|
||||
find('.jasmine-spec-list-menu').onclick = function() {
|
||||
setMenuModeTo('jasmine-spec-list');
|
||||
return false;
|
||||
};
|
||||
|
||||
setMenuModeTo('jasmine-failure-list');
|
||||
|
||||
const failureNode = find('.jasmine-failures');
|
||||
for (let i = 0; i < failures.length; i++) {
|
||||
failureNode.appendChild(failures[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function failureDom(result) {
|
||||
const failure = createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-spec-detail jasmine-failed' },
|
||||
failureDescription(result, stateBuilder.currentParent),
|
||||
createDom('div', { className: 'jasmine-messages' })
|
||||
);
|
||||
const messages = failure.childNodes[1];
|
||||
|
||||
for (let i = 0; i < result.failedExpectations.length; i++) {
|
||||
const expectation = result.failedExpectations[i];
|
||||
messages.appendChild(
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-result-message' },
|
||||
expectation.message
|
||||
)
|
||||
);
|
||||
messages.appendChild(
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-stack-trace' },
|
||||
expectation.stack
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (result.failedExpectations.length === 0) {
|
||||
messages.appendChild(
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-result-message' },
|
||||
'Spec has no expectations'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (result.debugLogs) {
|
||||
messages.appendChild(debugLogTable(result.debugLogs));
|
||||
}
|
||||
|
||||
return failure;
|
||||
}
|
||||
|
||||
function debugLogTable(debugLogs) {
|
||||
const tbody = createDom('tbody');
|
||||
|
||||
debugLogs.forEach(function(entry) {
|
||||
tbody.appendChild(
|
||||
createDom(
|
||||
'tr',
|
||||
{},
|
||||
createDom('td', {}, entry.timestamp.toString()),
|
||||
createDom('td', {}, entry.message)
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
return createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-debug-log' },
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-debug-log-header' },
|
||||
'Debug logs'
|
||||
),
|
||||
createDom(
|
||||
'table',
|
||||
{},
|
||||
createDom(
|
||||
'thead',
|
||||
{},
|
||||
createDom(
|
||||
'tr',
|
||||
{},
|
||||
createDom('th', {}, 'Time (ms)'),
|
||||
createDom('th', {}, 'Message')
|
||||
)
|
||||
),
|
||||
tbody
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function summaryList(resultsTree, domParent) {
|
||||
let specListNode;
|
||||
for (let i = 0; i < resultsTree.children.length; i++) {
|
||||
const resultNode = resultsTree.children[i];
|
||||
if (filterSpecs && !hasActiveSpec(resultNode)) {
|
||||
continue;
|
||||
}
|
||||
if (resultNode.type === 'suite') {
|
||||
const suiteListNode = createDom(
|
||||
'ul',
|
||||
{ className: 'jasmine-suite', id: 'suite-' + resultNode.result.id },
|
||||
createDom(
|
||||
'li',
|
||||
{
|
||||
className:
|
||||
'jasmine-suite-detail jasmine-' + resultNode.result.status
|
||||
},
|
||||
createDom(
|
||||
'a',
|
||||
{ href: specHref(resultNode.result) },
|
||||
resultNode.result.description
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
summaryList(resultNode, suiteListNode);
|
||||
domParent.appendChild(suiteListNode);
|
||||
}
|
||||
if (resultNode.type === 'spec') {
|
||||
if (domParent.getAttribute('class') !== 'jasmine-specs') {
|
||||
specListNode = createDom('ul', { className: 'jasmine-specs' });
|
||||
domParent.appendChild(specListNode);
|
||||
}
|
||||
let specDescription = resultNode.result.description;
|
||||
if (noExpectations(resultNode.result)) {
|
||||
specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription;
|
||||
}
|
||||
if (
|
||||
resultNode.result.status === 'pending' &&
|
||||
resultNode.result.pendingReason !== ''
|
||||
) {
|
||||
specDescription =
|
||||
specDescription +
|
||||
' PENDING WITH MESSAGE: ' +
|
||||
resultNode.result.pendingReason;
|
||||
}
|
||||
specListNode.appendChild(
|
||||
createDom(
|
||||
'li',
|
||||
{
|
||||
className: 'jasmine-' + resultNode.result.status,
|
||||
id: 'spec-' + resultNode.result.id
|
||||
},
|
||||
createDom(
|
||||
'a',
|
||||
{ href: specHref(resultNode.result) },
|
||||
specDescription
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function optionsMenu(config) {
|
||||
const optionsMenuDom = createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-run-options' },
|
||||
createDom('span', { className: 'jasmine-trigger' }, 'Options'),
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-payload' },
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-stop-on-failure' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-fail-fast',
|
||||
id: 'jasmine-fail-fast',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom(
|
||||
'label',
|
||||
{ className: 'jasmine-label', for: 'jasmine-fail-fast' },
|
||||
'stop execution on spec failure'
|
||||
)
|
||||
),
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-throw-failures' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-throw',
|
||||
id: 'jasmine-throw-failures',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom(
|
||||
'label',
|
||||
{ className: 'jasmine-label', for: 'jasmine-throw-failures' },
|
||||
'stop spec on expectation failure'
|
||||
)
|
||||
),
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-random-order' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-random',
|
||||
id: 'jasmine-random-order',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom(
|
||||
'label',
|
||||
{ className: 'jasmine-label', for: 'jasmine-random-order' },
|
||||
'run tests in random order'
|
||||
)
|
||||
),
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-hide-disabled' },
|
||||
createDom('input', {
|
||||
className: 'jasmine-disabled',
|
||||
id: 'jasmine-hide-disabled',
|
||||
type: 'checkbox'
|
||||
}),
|
||||
createDom(
|
||||
'label',
|
||||
{ className: 'jasmine-label', for: 'jasmine-hide-disabled' },
|
||||
'hide disabled tests'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
const failFastCheckbox = optionsMenuDom.querySelector(
|
||||
'#jasmine-fail-fast'
|
||||
);
|
||||
failFastCheckbox.checked = config.stopOnSpecFailure;
|
||||
failFastCheckbox.onclick = function() {
|
||||
navigateWithNewParam('stopOnSpecFailure', !config.stopOnSpecFailure);
|
||||
};
|
||||
|
||||
const throwCheckbox = optionsMenuDom.querySelector(
|
||||
'#jasmine-throw-failures'
|
||||
);
|
||||
throwCheckbox.checked = config.stopSpecOnExpectationFailure;
|
||||
throwCheckbox.onclick = function() {
|
||||
navigateWithNewParam(
|
||||
'stopSpecOnExpectationFailure',
|
||||
!config.stopSpecOnExpectationFailure
|
||||
);
|
||||
};
|
||||
|
||||
const randomCheckbox = optionsMenuDom.querySelector(
|
||||
'#jasmine-random-order'
|
||||
);
|
||||
randomCheckbox.checked = config.random;
|
||||
randomCheckbox.onclick = function() {
|
||||
navigateWithNewParam('random', !config.random);
|
||||
};
|
||||
|
||||
const hideDisabled = optionsMenuDom.querySelector(
|
||||
'#jasmine-hide-disabled'
|
||||
);
|
||||
hideDisabled.checked = config.hideDisabled;
|
||||
hideDisabled.onclick = function() {
|
||||
navigateWithNewParam('hideDisabled', !config.hideDisabled);
|
||||
};
|
||||
|
||||
const optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'),
|
||||
optionsPayload = optionsMenuDom.querySelector('.jasmine-payload'),
|
||||
isOpen = /\bjasmine-open\b/;
|
||||
|
||||
optionsTrigger.onclick = function() {
|
||||
if (isOpen.test(optionsPayload.className)) {
|
||||
optionsPayload.className = optionsPayload.className.replace(
|
||||
isOpen,
|
||||
''
|
||||
);
|
||||
} else {
|
||||
optionsPayload.className += ' jasmine-open';
|
||||
}
|
||||
};
|
||||
|
||||
return optionsMenuDom;
|
||||
}
|
||||
|
||||
function failureDescription(result, suite) {
|
||||
const wrapper = createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-description' },
|
||||
createDom(
|
||||
'a',
|
||||
{ title: result.description, href: specHref(result) },
|
||||
result.description
|
||||
)
|
||||
);
|
||||
let suiteLink;
|
||||
|
||||
while (suite && suite.parent) {
|
||||
wrapper.insertBefore(createTextNode(' > '), wrapper.firstChild);
|
||||
suiteLink = createDom(
|
||||
'a',
|
||||
{ href: suiteHref(suite) },
|
||||
suite.result.description
|
||||
);
|
||||
wrapper.insertBefore(suiteLink, wrapper.firstChild);
|
||||
|
||||
suite = suite.parent;
|
||||
}
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
function suiteHref(suite) {
|
||||
const els = [];
|
||||
|
||||
while (suite && suite.parent) {
|
||||
els.unshift(suite.result.description);
|
||||
suite = suite.parent;
|
||||
}
|
||||
|
||||
// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
|
||||
return (
|
||||
(window.location.pathname || '') +
|
||||
addToExistingQueryString('spec', els.join(' '))
|
||||
);
|
||||
}
|
||||
|
||||
function addDeprecationWarnings(result, runnableType) {
|
||||
if (result && result.deprecationWarnings) {
|
||||
for (let i = 0; i < result.deprecationWarnings.length; i++) {
|
||||
const warning = result.deprecationWarnings[i].message;
|
||||
deprecationWarnings.push({
|
||||
message: warning,
|
||||
stack: result.deprecationWarnings[i].stack,
|
||||
runnableName: result.fullName,
|
||||
runnableType: runnableType
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createExpander(stackTrace) {
|
||||
const expandLink = createDom('a', { href: '#' }, 'Show stack trace');
|
||||
const root = createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-expander' },
|
||||
expandLink,
|
||||
createDom(
|
||||
'div',
|
||||
{ className: 'jasmine-expander-contents jasmine-stack-trace' },
|
||||
stackTrace
|
||||
)
|
||||
);
|
||||
|
||||
expandLink.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (root.classList.contains('jasmine-expanded')) {
|
||||
root.classList.remove('jasmine-expanded');
|
||||
expandLink.textContent = 'Show stack trace';
|
||||
} else {
|
||||
root.classList.add('jasmine-expanded');
|
||||
expandLink.textContent = 'Hide stack trace';
|
||||
}
|
||||
});
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
function find(selector) {
|
||||
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
|
||||
}
|
||||
|
||||
function clearPrior() {
|
||||
const oldReporter = find('');
|
||||
|
||||
if (oldReporter) {
|
||||
getContainer().removeChild(oldReporter);
|
||||
}
|
||||
}
|
||||
|
||||
function createDom(type, attrs, childrenArrayOrVarArgs) {
|
||||
const el = createElement(type);
|
||||
let children;
|
||||
|
||||
if (j$.isArray_(childrenArrayOrVarArgs)) {
|
||||
children = childrenArrayOrVarArgs;
|
||||
} else {
|
||||
children = [];
|
||||
|
||||
for (let i = 2; i < arguments.length; i++) {
|
||||
children.push(arguments[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(createTextNode(child));
|
||||
} else {
|
||||
if (child) {
|
||||
el.appendChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const attr in attrs) {
|
||||
if (attr == 'className') {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
function pluralize(singular, count) {
|
||||
const word = count == 1 ? singular : singular + 's';
|
||||
|
||||
return '' + count + ' ' + word;
|
||||
}
|
||||
|
||||
function specHref(result) {
|
||||
// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
|
||||
return (
|
||||
(window.location.pathname || '') +
|
||||
addToExistingQueryString('spec', result.fullName)
|
||||
);
|
||||
}
|
||||
|
||||
function seedHref(seed) {
|
||||
// include window.location.pathname to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
|
||||
return (
|
||||
(window.location.pathname || '') +
|
||||
addToExistingQueryString('seed', seed)
|
||||
);
|
||||
}
|
||||
|
||||
function defaultQueryString(key, value) {
|
||||
return '?' + key + '=' + value;
|
||||
}
|
||||
|
||||
function setMenuModeTo(mode) {
|
||||
htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode);
|
||||
}
|
||||
|
||||
function noExpectations(result) {
|
||||
const allExpectations =
|
||||
result.failedExpectations.length + result.passedExpectations.length;
|
||||
|
||||
return (
|
||||
allExpectations === 0 &&
|
||||
(result.status === 'passed' || result.status === 'failed')
|
||||
);
|
||||
}
|
||||
|
||||
function hasActiveSpec(resultNode) {
|
||||
if (resultNode.type == 'spec' && resultNode.result.status != 'excluded') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (resultNode.type == 'suite') {
|
||||
for (let i = 0, j = resultNode.children.length; i < j; i++) {
|
||||
if (hasActiveSpec(resultNode.children[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HtmlReporter;
|
||||
};
|
||||
|
||||
jasmineRequire.HtmlSpecFilter = function() {
|
||||
function HtmlSpecFilter(options) {
|
||||
const filterString =
|
||||
options &&
|
||||
options.filterString() &&
|
||||
options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
const filterPattern = new RegExp(filterString);
|
||||
|
||||
this.matches = function(specName) {
|
||||
return filterPattern.test(specName);
|
||||
};
|
||||
}
|
||||
|
||||
return HtmlSpecFilter;
|
||||
};
|
||||
|
||||
jasmineRequire.ResultsNode = function() {
|
||||
function ResultsNode(result, type, parent) {
|
||||
this.result = result;
|
||||
this.type = type;
|
||||
this.parent = parent;
|
||||
|
||||
this.children = [];
|
||||
|
||||
this.addChild = function(result, type) {
|
||||
this.children.push(new ResultsNode(result, type, this));
|
||||
};
|
||||
|
||||
this.last = function() {
|
||||
return this.children[this.children.length - 1];
|
||||
};
|
||||
|
||||
this.updateResult = function(result) {
|
||||
this.result = result;
|
||||
};
|
||||
}
|
||||
|
||||
return ResultsNode;
|
||||
};
|
||||
|
||||
jasmineRequire.QueryString = function() {
|
||||
function QueryString(options) {
|
||||
this.navigateWithNewParam = function(key, value) {
|
||||
options.getWindowLocation().search = this.fullStringWithNewParam(
|
||||
key,
|
||||
value
|
||||
);
|
||||
};
|
||||
|
||||
this.fullStringWithNewParam = function(key, value) {
|
||||
const paramMap = queryStringToParamMap();
|
||||
paramMap[key] = value;
|
||||
return toQueryString(paramMap);
|
||||
};
|
||||
|
||||
this.getParam = function(key) {
|
||||
return queryStringToParamMap()[key];
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function toQueryString(paramMap) {
|
||||
const qStrPairs = [];
|
||||
for (const prop in paramMap) {
|
||||
qStrPairs.push(
|
||||
encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])
|
||||
);
|
||||
}
|
||||
return '?' + qStrPairs.join('&');
|
||||
}
|
||||
|
||||
function queryStringToParamMap() {
|
||||
const paramStr = options.getWindowLocation().search.substring(1);
|
||||
let params = [];
|
||||
const paramMap = {};
|
||||
|
||||
if (paramStr.length > 0) {
|
||||
params = paramStr.split('&');
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
const p = params[i].split('=');
|
||||
let value = decodeURIComponent(p[1]);
|
||||
if (value === 'true' || value === 'false') {
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
paramMap[decodeURIComponent(p[0])] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return paramMap;
|
||||
}
|
||||
}
|
||||
|
||||
return QueryString;
|
||||
};
|
300
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.css
generated
vendored
Executable file
300
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.css
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
10488
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
generated
vendored
Executable file
10488
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
generated
vendored
Executable file
File diff suppressed because it is too large
Load diff
38
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/node_boot.js
generated
vendored
Executable file
38
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/lib/jasmine-core/node_boot.js
generated
vendored
Executable file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
Copyright (c) 2008-2023 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
module.exports = function(jasmineRequire) {
|
||||
const jasmine = jasmineRequire.core(jasmineRequire);
|
||||
|
||||
const env = jasmine.getEnv({ suppressLoadErrors: true });
|
||||
|
||||
const jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
extend(global, jasmineInterface);
|
||||
|
||||
function extend(destination, source) {
|
||||
for (const property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
return jasmine;
|
||||
};
|
110
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/package.json
generated
vendored
Executable file
110
my-app/node_modules/karma-jasmine/node_modules/jasmine-core/package.json
generated
vendored
Executable file
|
@ -0,0 +1,110 @@
|
|||
{
|
||||
"name": "jasmine-core",
|
||||
"license": "MIT",
|
||||
"version": "4.6.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jasmine/jasmine.git"
|
||||
},
|
||||
"keywords": [
|
||||
"test",
|
||||
"testing",
|
||||
"jasmine",
|
||||
"tdd",
|
||||
"bdd"
|
||||
],
|
||||
"scripts": {
|
||||
"posttest": "eslint \"src/**/*.js\" \"spec/**/*.js\" && prettier --check \"src/**/*.js\" \"spec/**/*.js\"",
|
||||
"test": "grunt --stack execSpecsInNode",
|
||||
"cleanup": "prettier --write \"src/**/*.js\" \"spec/**/*.js\"",
|
||||
"build": "grunt buildDistribution",
|
||||
"serve": "node spec/support/localJasmineBrowser.js",
|
||||
"serve:performance": "node spec/support/localJasmineBrowser.js jasmine-browser-performance.json",
|
||||
"ci": "node spec/support/ci.js",
|
||||
"ci:performance": "node spec/support/ci.js jasmine-browser-performance.json"
|
||||
},
|
||||
"description": "Simple JavaScript testing framework for browsers and node.js",
|
||||
"homepage": "https://jasmine.github.io",
|
||||
"main": "./lib/jasmine-core.js",
|
||||
"files": [
|
||||
"MIT.LICENSE",
|
||||
"README.md",
|
||||
"images/*.{png,svg}",
|
||||
"lib/**/*.{js,css}",
|
||||
"package.json"
|
||||
],
|
||||
"devDependencies": {
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-compat": ">=4.0.0 <4.1.0",
|
||||
"glob": "^7.2.0",
|
||||
"grunt": ">=1.0.4 <1.6.0",
|
||||
"grunt-cli": "^1.3.2",
|
||||
"grunt-contrib-compress": "^2.0.0",
|
||||
"grunt-contrib-concat": "^2.0.0",
|
||||
"grunt-css-url-embed": "^1.11.1",
|
||||
"grunt-sass": "^3.0.2",
|
||||
"jasmine": "^4.1.0",
|
||||
"jasmine-browser-runner": "^1.0.0",
|
||||
"jsdom": "^19.0.0",
|
||||
"load-grunt-tasks": "^5.1.0",
|
||||
"prettier": "1.17.1",
|
||||
"sass": "1.58.3",
|
||||
"shelljs": "^0.8.3",
|
||||
"temp": "^0.9.0"
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"plugin:compat/recommended"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"es2017": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"rules": {
|
||||
"quotes": [
|
||||
"error",
|
||||
"single",
|
||||
{
|
||||
"avoidEscape": true
|
||||
}
|
||||
],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
"no-implicit-globals": "error",
|
||||
"block-spacing": "error",
|
||||
"func-call-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"key-spacing": "error",
|
||||
"no-tabs": "error",
|
||||
"no-trailing-spaces": "error",
|
||||
"no-whitespace-before-property": "error",
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"space-before-blocks": "error",
|
||||
"no-eval": "error",
|
||||
"no-var": "error"
|
||||
}
|
||||
},
|
||||
"browserslist": [
|
||||
"Safari >= 14",
|
||||
"last 2 Chrome versions",
|
||||
"last 2 Firefox versions",
|
||||
"Firefox >= 91",
|
||||
"last 2 Edge versions"
|
||||
]
|
||||
}
|
115
my-app/node_modules/karma-jasmine/package.json
generated
vendored
Executable file
115
my-app/node_modules/karma-jasmine/package.json
generated
vendored
Executable file
|
@ -0,0 +1,115 @@
|
|||
{
|
||||
"name": "karma-jasmine",
|
||||
"version": "5.1.0",
|
||||
"description": "A Karma plugin - adapter for Jasmine testing framework.",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib/*.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grunt build",
|
||||
"lint": "eslint \"**/*.js\"",
|
||||
"lint:fix": "eslint --fix \"**/*.js\"",
|
||||
"commitlint": "commitlint",
|
||||
"test": "npm run test:unit && npm run test:e2e && npm run test:integration",
|
||||
"test:unit": "jasmine",
|
||||
"test:e2e": "karma start karma.conf.js",
|
||||
"test:integration": "bash tools/integration-tests.sh",
|
||||
"release": "semantic-release"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/karma-runner/karma-jasmine.git"
|
||||
},
|
||||
"keywords": [
|
||||
"karma-plugin",
|
||||
"karma-adapter",
|
||||
"jasmine"
|
||||
],
|
||||
"author": "Vojta Jina <vojta.jina@gmail.com>",
|
||||
"dependencies": {
|
||||
"jasmine-core": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^16.2.3",
|
||||
"@commitlint/config-angular": "^16.2.3",
|
||||
"@semantic-release/changelog": "^6.0.1",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/github": "^8.0.4",
|
||||
"@semantic-release/npm": "^9.0.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.2.0",
|
||||
"eslint-plugin-standard": "^4.1.0",
|
||||
"grunt": "^1.5.2",
|
||||
"husky": "^4.3.8",
|
||||
"jasmine": "^4.1.0",
|
||||
"karma": "^6.3.18",
|
||||
"karma-firefox-launcher": "^2.1.2",
|
||||
"semantic-release": "^19.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"karma": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
"Maksim Ryzhikov <rv.maksim@gmail.com>",
|
||||
"johnjbarton <johnjbarton@johnjbarton.com>",
|
||||
"Jonathan Ginsburg <jon@than.ml>",
|
||||
"Mark Ethan Trostler <mark@zzo.com>",
|
||||
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
|
||||
"XhmikosR <xhmikosr@gmail.com>",
|
||||
"olegskl <sklyanchuk@gmail.com>",
|
||||
"semantic-release-bot <semantic-release-bot@martynus.net>",
|
||||
"dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>",
|
||||
"dignifiedquire <dignifiedquire@gmail.com>",
|
||||
"Cornelius Schmale <github@cschmale.de>",
|
||||
"Arthur Thornton <arthur@thestorefront.com>",
|
||||
"Friedel Ziegelmayer <friedel.ziegelmayer@gmail.com>",
|
||||
"Patrick McGuckin <patrick@gskinner.com>",
|
||||
"Richard Park <objectiv@gmail.com>",
|
||||
"Fernando Costa <fadc80@gmail.com>",
|
||||
"Nico Jansen <jansennico@gmail.com>",
|
||||
"Aaron Hartwig <aaron.hartwig@whyhigh.com>",
|
||||
"Alesei N <github.com@bzik.net>",
|
||||
"Barry Fitzgerald <barfitzgerald@gmail.com>",
|
||||
"Dirk T <DirkToewe@GoogleMail.com>",
|
||||
"Dmitriy Tychshenko <dtychshenko@users.noreply.github.com>",
|
||||
"Flavian Hautbois <flavian@apricity.life>",
|
||||
"Georgii Dolzhykov <thorn.mailbox@gmail.com>",
|
||||
"Gregg Van Hove <gvanhove@pivotal.io>",
|
||||
"Jacob Trimble <modmaker@google.com>",
|
||||
"João Pereira <joaopapereira@gmail.com>",
|
||||
"Keen Yee Liau <kyliau@google.com>",
|
||||
"Limon Monte <limon.monte@gmail.com>",
|
||||
"Luis Aleman <Lalem001@users.noreply.github.com>",
|
||||
"Marek Vavrecan <vavrecan@gmail.com>",
|
||||
"Matthew Hill <Matthew.Hill4@bskyb.com>",
|
||||
"Milan Lempera <milanlempera@gmail.com>",
|
||||
"Niels Dequeker <niels.dequeker@gmail.com>",
|
||||
"Robin Gloster <robin@loc-com.de>",
|
||||
"Sahat Yalkabov <sakhat@gmail.com>",
|
||||
"Sampo Kivistö <sampo.kivisto@visma.com>",
|
||||
"Schaaf, Martin <703355+mschaaf@users.noreply.github.com>",
|
||||
"Sergey Tatarintsev <sevinf@yandex-team.ru>",
|
||||
"Sid Vishnoi <sidvishnoi8@gmail.com>",
|
||||
"Stefan Dragnev <dragnev@telerik.com>",
|
||||
"Tobias Speicher <rootcommander@gmail.com>",
|
||||
"Todd Wolfson <todd@twolfson.com>",
|
||||
"Vladimir Belov <Vladimir.Belov@hotmail.com>",
|
||||
"Yusuke Iinuma <yinm@users.noreply.github.com>",
|
||||
"jiverson <jiverson222@gmail.com>",
|
||||
"rpark <objectiv@gmail.com>",
|
||||
"strille <strille@users.noreply.github.com>"
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue