Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f18595399 | |||
| 6c50f14f3b | |||
| a0fbbd7f67 | |||
| 199517abaa | |||
| 273f429754 | |||
| 90e0dbcad1 | |||
| bfec8763d7 | |||
| 7375b5279d | |||
| 909d5e9a88 | |||
| 40569149f8 | |||
| 07b60547b6 | |||
| 8ec5b9761c | |||
| 1b8a4804b7 | |||
| 65622305ae | |||
| c2341034d4 | |||
| e5503c98d8 | |||
| e0a90dd473 | |||
| 95a6085a01 | |||
| 0b02e82229 | |||
| 53305edc68 | |||
| d2fe23b52b | |||
| e26c3754b0 | |||
| 9b42df2cbf | |||
| a1ea56c1ac | |||
| 8dc4d979ff | |||
| 92e671692f | |||
| c8b38ea47a | |||
| 5821de0801 | |||
| d4683ca485 | |||
| 81aeeeedee | |||
| 2045226ba7 | |||
| 00c7d3ca29 | |||
| 73c8fef43e | |||
| 59c85355fc | |||
| e4a5d567e0 | |||
| 0c8258996e | |||
| 945b167131 | |||
| ffb69b4bde | |||
| 81748d166d | |||
| dd0e3e5cf1 | |||
| 1f50e2b2fb | |||
| 24a8bb7825 | |||
| 8fbec47739 | |||
| b38f2aa5be | |||
| 73597fc8a5 | |||
| a476f5b91c | |||
| 494d80fc66 | |||
| 4b3db52915 | |||
| 772d9ed697 | |||
| 7b1de037f8 | |||
| 3891b8afe4 | |||
| 692ae5980a | |||
| 2b9667c82e | |||
| e3585b79f0 | |||
| 1c2780d0c1 | |||
| bece09bba8 | |||
| 7c043eb5d0 | |||
| fcc1872d48 | |||
| 391c42533f | |||
| 546604fdc8 | |||
| 766eacc88b | |||
| c61c69d256 | |||
| eae0dbdc57 | |||
| abe34315a0 | |||
| 98dd13c9b2 | |||
| 2c60b0a546 | |||
| 27f165e241 | |||
| 75bb56f294 | |||
| add3e1ee7a | |||
| baf1bf10f6 | |||
| 504ba8c54d |
@@ -1,216 +0,0 @@
|
|||||||
# Run tests against supported Node versions, and (except for pull requests)
|
|
||||||
# against supported browsers.
|
|
||||||
|
|
||||||
version: 2.1
|
|
||||||
|
|
||||||
orbs:
|
|
||||||
node: circleci/node@3.0.0
|
|
||||||
|
|
||||||
executors:
|
|
||||||
node16:
|
|
||||||
docker:
|
|
||||||
- image: cimg/node:16.1.0-browsers
|
|
||||||
working_directory: ~/workspace
|
|
||||||
node14:
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:14
|
|
||||||
working_directory: ~/workspace
|
|
||||||
node12:
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:12
|
|
||||||
working_directory: ~/workspace
|
|
||||||
node10:
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:10
|
|
||||||
working_directory: ~/workspace
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
parameters:
|
|
||||||
executor:
|
|
||||||
type: executor
|
|
||||||
executor: << parameters.executor >>
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run:
|
|
||||||
name: Report Node and NPM versions
|
|
||||||
command: echo "Using Node $(node --version) and NPM $(npm --version)"
|
|
||||||
- run:
|
|
||||||
name: Install dependencies
|
|
||||||
command: npm install
|
|
||||||
- run:
|
|
||||||
name: Build
|
|
||||||
command: npm run build
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: .
|
|
||||||
paths:
|
|
||||||
- .
|
|
||||||
|
|
||||||
test_node: &test_node
|
|
||||||
parameters:
|
|
||||||
executor:
|
|
||||||
type: executor
|
|
||||||
executor: << parameters.executor >>
|
|
||||||
steps:
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: Run tests
|
|
||||||
command: npm test
|
|
||||||
|
|
||||||
# Warning: Sometimes takes a very long time (>25 minutes) on Circle.
|
|
||||||
# Probably not a good idea to run it from anything but a nightly.
|
|
||||||
test_node_with_long_property_tests:
|
|
||||||
<<: *test_node
|
|
||||||
environment:
|
|
||||||
JASMINE_LONG_PROPERTY_TESTS: y
|
|
||||||
|
|
||||||
test_browsers: &test_browsers
|
|
||||||
executor: node14
|
|
||||||
environment:
|
|
||||||
SKIP_JASMINE_BROWSER_FLAKES: "true"
|
|
||||||
steps:
|
|
||||||
- attach_workspace:
|
|
||||||
at: .
|
|
||||||
- run:
|
|
||||||
name: Install Sauce Connect
|
|
||||||
command: |
|
|
||||||
cd /tmp
|
|
||||||
curl https://saucelabs.com/downloads/sc-4.6.4-linux.tar.gz | tar zxf -
|
|
||||||
chmod +x sc-4.6.4-linux/bin/sc
|
|
||||||
mkdir ~/workspace/bin
|
|
||||||
cp sc-4.6.4-linux/bin/sc ~/workspace/bin
|
|
||||||
~/workspace/bin/sc --version
|
|
||||||
- run:
|
|
||||||
name: Run tests
|
|
||||||
command: |
|
|
||||||
# Do everything in one step because Sauce Connect won't exit
|
|
||||||
# cleanly if we kill it from a different step than it started in.
|
|
||||||
|
|
||||||
export PATH=$PATH:$HOME/workspace/bin
|
|
||||||
export SAUCE_TUNNEL_IDENTIFIER=$CIRCLE_BUILD_NUM
|
|
||||||
scripts/start-sauce-connect sauce-pidfile
|
|
||||||
set +o errexit
|
|
||||||
scripts/run-all-browsers
|
|
||||||
exitcode=$?
|
|
||||||
set -o errexit
|
|
||||||
scripts/stop-sauce-connect $(cat sauce-pidfile)
|
|
||||||
exit $exitcode
|
|
||||||
|
|
||||||
test_browser_flakes:
|
|
||||||
<<: *test_browsers
|
|
||||||
environment:
|
|
||||||
SKIP_JASMINE_BROWSER_FLAKES: "false"
|
|
||||||
|
|
||||||
workflows:
|
|
||||||
version: 2
|
|
||||||
cron:
|
|
||||||
triggers:
|
|
||||||
- schedule:
|
|
||||||
# Times are UTC.
|
|
||||||
cron: "0 10 * * *"
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- main
|
|
||||||
- "3.99"
|
|
||||||
- "4.0"
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
executor: node16
|
|
||||||
name: build_node_16
|
|
||||||
- build:
|
|
||||||
executor: node14
|
|
||||||
name: build_node_14
|
|
||||||
- build:
|
|
||||||
executor: node12
|
|
||||||
name: build_node_12
|
|
||||||
- build:
|
|
||||||
executor: node10
|
|
||||||
name: build_node_10
|
|
||||||
- test_node:
|
|
||||||
executor: node16
|
|
||||||
name: test_node_16
|
|
||||||
requires:
|
|
||||||
- build_node_16
|
|
||||||
- test_node_with_long_property_tests:
|
|
||||||
executor: node14
|
|
||||||
requires:
|
|
||||||
- build_node_14
|
|
||||||
- test_node:
|
|
||||||
executor: node12
|
|
||||||
name: test_node_12
|
|
||||||
requires:
|
|
||||||
- build_node_12
|
|
||||||
- test_node:
|
|
||||||
executor: node10
|
|
||||||
name: test_node_10
|
|
||||||
requires:
|
|
||||||
- build_node_10
|
|
||||||
- test_browsers:
|
|
||||||
requires:
|
|
||||||
- build_node_14
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /pull\/.*/ # Don't run on pull requests.
|
|
||||||
|
|
||||||
push:
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
executor: node16
|
|
||||||
name: build_node_16
|
|
||||||
- build:
|
|
||||||
executor: node14
|
|
||||||
name: build_node_14
|
|
||||||
- build:
|
|
||||||
executor: node12
|
|
||||||
name: build_node_12
|
|
||||||
- build:
|
|
||||||
executor: node10
|
|
||||||
name: build_node_10
|
|
||||||
- test_node:
|
|
||||||
executor: node16
|
|
||||||
name: test_node_16
|
|
||||||
requires:
|
|
||||||
- build_node_16
|
|
||||||
- test_node:
|
|
||||||
executor: node14
|
|
||||||
name: test_node_14
|
|
||||||
requires:
|
|
||||||
- build_node_14
|
|
||||||
- test_node:
|
|
||||||
executor: node12
|
|
||||||
name: test_node_12
|
|
||||||
requires:
|
|
||||||
- build_node_12
|
|
||||||
- test_node:
|
|
||||||
executor: node10
|
|
||||||
name: test_node_10
|
|
||||||
requires:
|
|
||||||
- build_node_10
|
|
||||||
- test_browsers:
|
|
||||||
requires:
|
|
||||||
- build_node_14
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /pull\/.*/ # Don't run on pull requests.
|
|
||||||
|
|
||||||
browser-flakes:
|
|
||||||
triggers:
|
|
||||||
- schedule:
|
|
||||||
# Times are UTC.
|
|
||||||
cron: "0 11 * * *"
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
- build:
|
|
||||||
executor: node14
|
|
||||||
name: build_node_14
|
|
||||||
- test_browser_flakes:
|
|
||||||
requires:
|
|
||||||
- build_node_14
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
ignore: /pull\/.*/ # Don't run on pull requests.
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.{js, json, sh, yml, gemspec}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[{Rakefile, .jshintrc}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
[*.{py}]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
* text=auto eol=lf
|
|
||||||
*.png -text
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
# Developing for Jasmine Core
|
|
||||||
|
|
||||||
We welcome your contributions! Thanks for helping make Jasmine a better project
|
|
||||||
for everyone. Please review the backlog and discussion lists before starting
|
|
||||||
work. What you're looking for may already have been done. If it hasn't, the
|
|
||||||
community can help make your contribution better. If you want to contribute but
|
|
||||||
don't know what to work on,
|
|
||||||
[issues tagged help needed](https://github.com/jasmine/jasmine/labels/help%20needed)
|
|
||||||
should have enough detail to get started.
|
|
||||||
|
|
||||||
## Links
|
|
||||||
|
|
||||||
- [Jasmine Google Group](http://groups.google.com/group/jasmine-js)
|
|
||||||
- [Jasmine-dev Google Group](http://groups.google.com/group/jasmine-js-dev)
|
|
||||||
- [Jasmine on PivotalTracker](https://www.pivotaltracker.com/n/projects/10606)
|
|
||||||
|
|
||||||
## General Workflow
|
|
||||||
|
|
||||||
Please submit pull requests via feature branches using the semi-standard workflow of:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone git@github.com:yourUserName/jasmine.git # Clone your fork
|
|
||||||
cd jasmine # Change directory
|
|
||||||
git remote add upstream https://github.com/jasmine/jasmine.git # Assign original repository to a remote named 'upstream'
|
|
||||||
git fetch upstream # Fetch changes not present in your local repository
|
|
||||||
git merge upstream/main # Sync local main with upstream repository
|
|
||||||
git checkout -b my-new-feature # Create your feature branch
|
|
||||||
git commit -am 'Add some feature' # Commit your changes
|
|
||||||
git push origin my-new-feature # Push to the branch
|
|
||||||
```
|
|
||||||
|
|
||||||
Once you've pushed a feature branch to your forked repo, you're ready to open a pull request. We favor pull requests with very small, single commits with a single purpose.
|
|
||||||
|
|
||||||
## Background
|
|
||||||
|
|
||||||
### Directory Structure
|
|
||||||
|
|
||||||
* `/src` contains all of the source files
|
|
||||||
* `/src/core` - generic source files
|
|
||||||
* `/src/html` - browser-specific files
|
|
||||||
* `/spec` contains all of the tests
|
|
||||||
* mirrors the source directory
|
|
||||||
* there are some additional files
|
|
||||||
* `/lib` contains the compiled copy of Jasmine. This is used to self-test and
|
|
||||||
distributed as the `jasmine-core` Node, Ruby, and Python packages.
|
|
||||||
|
|
||||||
### Self-testing
|
|
||||||
|
|
||||||
Note that Jasmine tests itself. The files in `lib` are loaded first, defining the reference `jasmine`. Then the files in `src` are loaded, defining the reference `jasmineUnderTest`. So there are two copies of the code loaded under test.
|
|
||||||
|
|
||||||
The tests should always use `jasmineUnderTest` to refer to the objects and functions that are being tested. But the tests can use functions on `jasmine` as needed. _Be careful how you structure any new test code_. Copy the patterns you see in the existing code - this ensures that the code you're testing is not leaking into the `jasmine` reference and vice-versa.
|
|
||||||
|
|
||||||
### `boot.js`
|
|
||||||
|
|
||||||
This file does all of the setup necessary for Jasmine to work. It loads all of the code, creates an `Env`, attaches the global functions, and builds the reporter. It also sets up the execution of the `Env` - for browsers this is in `window.onload`. While the default in `lib` is appropriate for browsers, projects may wish to customize this file.
|
|
||||||
|
|
||||||
### Compatibility
|
|
||||||
|
|
||||||
Jasmine runs in both Node and browsers, including some older browsers that do
|
|
||||||
not support the latest JavaScript features. See the README for the list of
|
|
||||||
currently supported environments.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
All source code belongs in `src/`. The `core/` directory contains the bulk of Jasmine's functionality. This code should remain browser- and environment-agnostic. If your feature or fix cannot be, as mentioned above, please degrade gracefully. Any code that depends on a browser (specifically, it expects `window` to be the global or `document` is present) should live in `src/html/`.
|
|
||||||
|
|
||||||
### Install Dev Dependencies
|
|
||||||
|
|
||||||
Jasmine Core relies on Node.js.
|
|
||||||
|
|
||||||
To install the Node dependencies, you will need Node.js and npm.
|
|
||||||
|
|
||||||
$ npm install
|
|
||||||
|
|
||||||
...will install all of the node modules locally. Now run
|
|
||||||
|
|
||||||
$ npm test
|
|
||||||
|
|
||||||
...you should see tests run and eslint checking formatting.
|
|
||||||
|
|
||||||
### How to write new Jasmine code
|
|
||||||
|
|
||||||
Or, How to make a successful pull request
|
|
||||||
|
|
||||||
* _Do not change the public interface_. Lots of projects depend on Jasmine and
|
|
||||||
if you aren't careful you'll break them.
|
|
||||||
* _Be environment agnostic_ - server-side developers are just as important as
|
|
||||||
browser developers.
|
|
||||||
* _Be browser agnostic_ - if you must rely on browser-specific functionality,
|
|
||||||
please write it in a way that degrades gracefully.
|
|
||||||
* _Write specs_ - Jasmine's a testing framework. Don't add functionality
|
|
||||||
without test-driving it.
|
|
||||||
* _Write code in the style of the rest of the repo_ - Jasmine should look like
|
|
||||||
a cohesive whole.
|
|
||||||
* _Ensure the *entire* test suite is green_ in all the big browsers, Node, and
|
|
||||||
ESLint. Your contribution shouldn't break Jasmine for other users.
|
|
||||||
|
|
||||||
Follow these tips and your pull request, patch, or suggestion is much more likely to be integrated.
|
|
||||||
|
|
||||||
### Running Specs
|
|
||||||
|
|
||||||
Be sure to run the tests in at least one supported Node version and at least a
|
|
||||||
couple of supported browsers. It's also a good idea to run the tests in Internet
|
|
||||||
Explorer if you've touched code in `src/html`, if your change involves newer
|
|
||||||
JavaScript language/runtime features, or if you're unfamiliar with writing code
|
|
||||||
for older browsers. To run the tests in Node, simply use `npm test` as described
|
|
||||||
above. To run the tests in a browser, run `npm run serve` and then visit
|
|
||||||
`http://localhost:8888`.
|
|
||||||
|
|
||||||
If you have the necessary Selenium drivers installed, you can also use Jasmine's
|
|
||||||
CI tooling:
|
|
||||||
|
|
||||||
$ JASMINE_BROWSER=<name of browser> node spec/support/ci.js
|
|
||||||
|
|
||||||
The easiest way to run the tests in **Internet Explorer** is to run a VM that has IE installed. It's easy to do this with VirtualBox.
|
|
||||||
|
|
||||||
1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
|
|
||||||
1. Download a VM image [from Microsoft](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/). Select "VirtualBox" as the platform.
|
|
||||||
1. Unzip the downloaded archive. There should be an OVA file inside.
|
|
||||||
1. In VirtualBox, choose `File > Import Appliance` and select the OVA file. Accept the default settings in the dialog that appears. Now you have a Windows VM!
|
|
||||||
1. Run the VM and start IE.
|
|
||||||
1. With `npm run serve` running on your host machine, navigate to `http://<your IP address>:8888` in IE.
|
|
||||||
|
|
||||||
## Before Committing or Submitting a Pull Request
|
|
||||||
|
|
||||||
1. Ensure all specs are green in browser *and* node.
|
|
||||||
1. Ensure eslint and prettier are clean as part of your `npm test` command. You can run `npm run cleanup` to have prettier re-write the files.
|
|
||||||
1. Build `jasmine.js` with `npm run build` and run all specs again - this ensures that your changes self-test well.
|
|
||||||
1. Revert your changes to `jasmine.js` and `jasmine-html.js`
|
|
||||||
* We do this because `jasmine.js` and `jasmine-html.js` are auto-generated (as you've seen in the previous steps) and accepting multiple pull requests when this auto-generated file changes causes lots of headaches
|
|
||||||
* When we accept your pull request, we will generate these files as a separate commit and merge the entire branch into main
|
|
||||||
|
|
||||||
Note that we use Circle CI for Continuous Integration. We only accept green pull requests.
|
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
## Are you creating an issue in the correct repository?
|
|
||||||
|
|
||||||
- When in doubt, create an issue here.
|
|
||||||
- If you have an issue with the Jasmine docs, file an issue in the docs repo
|
|
||||||
here: https://github.com/jasmine/jasmine.github.io
|
|
||||||
- If you have an issue with TypeScript typings, start a discussion at
|
|
||||||
[DefinitelyTpyed](https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/new?category=issues-with-a-types-package)
|
|
||||||
- This repository is for the core Jasmine framework
|
|
||||||
- If you are using a test runner that wraps Jasmine, consider filing an issue with that library if appropriate:
|
|
||||||
- [Jasmine npm](https://github.com/jasmine/jasmine-npm/issues)
|
|
||||||
- [Jasmine browser runner](https://github.com/jasmine/jasmine-browser/issues)
|
|
||||||
- [Jasmine gem](https://github.com/jasmine/jasmine-gem/issues)
|
|
||||||
- [Jasmine py](https://github.com/jasmine/jasmine-py/issues)
|
|
||||||
- [Gulp Jasmine Browser](https://github.com/jasmine/gulp-jasmine-browser/issues)
|
|
||||||
- [Karma](https://github.com/karma-runner/karma/issues)
|
|
||||||
- [Grunt Contrib Jasmine](https://github.com/gruntjs/grunt-contrib-jasmine/issues)
|
|
||||||
|
|
||||||
<!--- Provide a general summary of the issue in the Title above -->
|
|
||||||
|
|
||||||
## Expected Behavior
|
|
||||||
<!--- If you're describing a bug, tell us what should happen -->
|
|
||||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
|
||||||
|
|
||||||
## Current Behavior
|
|
||||||
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
|
||||||
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
|
||||||
|
|
||||||
## Possible Solution
|
|
||||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
|
||||||
<!--- or ideas how to implement the addition or change -->
|
|
||||||
|
|
||||||
## Suite that reproduces the behavior (for bugs)
|
|
||||||
<!--- Provide a sample suite that reproduces the bug. -->
|
|
||||||
```javascript
|
|
||||||
describe("sample", function() {
|
|
||||||
});
|
|
||||||
```
|
|
||||||
## Context
|
|
||||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
|
||||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
|
||||||
|
|
||||||
## Your Environment
|
|
||||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
|
||||||
* Version used:
|
|
||||||
* Environment name and version (e.g. Chrome 39, node.js 5.4):
|
|
||||||
* Operating System and version (desktop or mobile):
|
|
||||||
* Link to your project:
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<!--- Provide a general summary of your changes in the Title above -->
|
|
||||||
|
|
||||||
## Description
|
|
||||||
<!--- Describe your changes in detail -->
|
|
||||||
|
|
||||||
## Motivation and Context
|
|
||||||
<!--- Why is this change required? What problem does it solve? -->
|
|
||||||
<!--- If it fixes an open issue, please link to the issue here. -->
|
|
||||||
|
|
||||||
## How Has This Been Tested?
|
|
||||||
<!--- Please describe in detail how you tested your changes. -->
|
|
||||||
<!--- Include details of your testing environment, and the tests you ran to -->
|
|
||||||
<!--- see how your change affects other areas of the code, etc. -->
|
|
||||||
|
|
||||||
## Types of changes
|
|
||||||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
|
||||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
||||||
- [ ] New feature (non-breaking change which adds functionality)
|
|
||||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
|
||||||
|
|
||||||
## Checklist:
|
|
||||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
|
||||||
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
|
||||||
- [ ] My code follows the code style of this project.
|
|
||||||
- [ ] My change requires a change to the documentation.
|
|
||||||
- [ ] I have updated the documentation accordingly.
|
|
||||||
- [ ] I have read the **CONTRIBUTING** document.
|
|
||||||
- [ ] I have added tests to cover my changes.
|
|
||||||
- [ ] All new and existing tests passed.
|
|
||||||
|
|
||||||
+5
-28
@@ -1,28 +1,5 @@
|
|||||||
.idea/
|
.idea
|
||||||
.svn/
|
pkg
|
||||||
.DS_Store
|
vendor
|
||||||
site/
|
bin
|
||||||
.bundle/
|
!bin/jasmine
|
||||||
.pairs
|
|
||||||
.rvmrc
|
|
||||||
.ruby-gemset
|
|
||||||
.ruby-version
|
|
||||||
*.gem
|
|
||||||
.bundle
|
|
||||||
tags
|
|
||||||
Gemfile.lock
|
|
||||||
package-lock.json
|
|
||||||
yarn.lock
|
|
||||||
pkg/*
|
|
||||||
.sass-cache/*
|
|
||||||
src/html/.sass-cache/*
|
|
||||||
node_modules/
|
|
||||||
*.pyc
|
|
||||||
sauce_connect.log
|
|
||||||
*.swp
|
|
||||||
build/
|
|
||||||
*.egg-info/
|
|
||||||
dist
|
|
||||||
nbproject/
|
|
||||||
*.iml
|
|
||||||
.envrc
|
|
||||||
+3
-3
@@ -1,3 +1,3 @@
|
|||||||
[submodule "pages"]
|
[submodule "jasmine"]
|
||||||
path = pages
|
path = jasmine
|
||||||
url = https://github.com/pivotal/jasmine.git
|
url = git://github.com/pivotal/jasmine.git
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
||||||
|
|
||||||
## Our Standards
|
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment include:
|
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
|
||||||
* Being respectful of differing viewpoints and experiences
|
|
||||||
* Gracefully accepting constructive criticism
|
|
||||||
* Focusing on what is best for the community
|
|
||||||
* Showing empathy towards other community members
|
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
||||||
|
|
||||||
## Our Responsibilities
|
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
||||||
|
|
||||||
## Scope
|
|
||||||
|
|
||||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at jasmine-maintainers@googlegroups.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
|
||||||
|
|
||||||
## Attribution
|
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
|
||||||
|
|
||||||
[homepage]: http://contributor-covenant.org
|
|
||||||
[version]: http://contributor-covenant.org/version/1/4/
|
|
||||||
@@ -1,2 +1,12 @@
|
|||||||
source 'https://rubygems.org'
|
#jasmine-ruby is currently designed for use with bundler 0.8.0
|
||||||
gemspec
|
gem "rake", "0.8.7"
|
||||||
|
gem "jeweler", "1.4.0"
|
||||||
|
gem "gemcutter", "0.2.1"
|
||||||
|
|
||||||
|
gem "rspec", ">= 1.1.5", :only => :testing
|
||||||
|
gem "rack", ">= 1.0.0", :only => :testing
|
||||||
|
gem "thin", ">= 1.2.4", :only => :testing
|
||||||
|
gem "selenium-rc", ">=2.1.0", :only => :testing
|
||||||
|
gem "selenium-client", ">=1.2.17", :only => :testing
|
||||||
|
|
||||||
|
disable_system_gems
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
module.exports = function(grunt) {
|
|
||||||
var pkg = require("./package.json");
|
|
||||||
global.jasmineVersion = pkg.version;
|
|
||||||
|
|
||||||
grunt.initConfig({
|
|
||||||
pkg: pkg,
|
|
||||||
concat: require('./grunt/config/concat.js'),
|
|
||||||
sass: require('./grunt/config/sass.js'),
|
|
||||||
compress: require('./grunt/config/compress.js'),
|
|
||||||
cssUrlEmbed: require('./grunt/config/cssUrlEmbed.js')
|
|
||||||
});
|
|
||||||
|
|
||||||
require('load-grunt-tasks')(grunt);
|
|
||||||
|
|
||||||
grunt.loadTasks('grunt/tasks');
|
|
||||||
|
|
||||||
grunt.registerTask('default', ['sass:dist', "cssUrlEmbed"]);
|
|
||||||
|
|
||||||
var version = require('./grunt/tasks/version.js');
|
|
||||||
|
|
||||||
grunt.registerTask('build:copyVersionToGem',
|
|
||||||
"Propagates the version from package.json to version.rb",
|
|
||||||
version.copyToGem);
|
|
||||||
|
|
||||||
grunt.registerTask('buildDistribution',
|
|
||||||
'Builds and lints jasmine.js, jasmine-html.js, jasmine.css',
|
|
||||||
[
|
|
||||||
'sass:dist',
|
|
||||||
"cssUrlEmbed",
|
|
||||||
'concat'
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
grunt.registerTask("execSpecsInNode",
|
|
||||||
"Run Jasmine core specs in Node.js",
|
|
||||||
function() {
|
|
||||||
var done = this.async(),
|
|
||||||
Jasmine = require('jasmine'),
|
|
||||||
jasmineCore = require('./lib/jasmine-core.js'),
|
|
||||||
jasmine = new Jasmine({jasmineCore: jasmineCore});
|
|
||||||
|
|
||||||
jasmine.loadConfigFile('./spec/support/jasmine.json');
|
|
||||||
jasmine.onComplete(function(passed) {
|
|
||||||
done(passed);
|
|
||||||
});
|
|
||||||
|
|
||||||
jasmine.execute();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
grunt.registerTask("execSpecsInNode:performance",
|
|
||||||
"Run Jasmine performance specs in Node.js",
|
|
||||||
function() {
|
|
||||||
require("shelljs").exec("node_modules/.bin/jasmine JASMINE_CONFIG_PATH=spec/support/jasmine-performance.json");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
recursive-include . *.py
|
|
||||||
prune node_modules
|
|
||||||
include lib/jasmine-core/*.js
|
|
||||||
include lib/jasmine-core/*.css
|
|
||||||
include images/*.png
|
|
||||||
include package.json
|
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2008-2019 Pivotal Labs
|
Copyright (c) 2008 Pivotal Labs
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
jasmine-ruby
|
||||||
|
============
|
||||||
|
|
||||||
|
Jasmine Ruby dynamically serves HTML suites for [Jasmine](http://github.com/pivotal/jasmine)
|
||||||
|
|
||||||
|
To use:
|
||||||
|
|
||||||
|
`(sudo) gem install jasmine`
|
||||||
|
|
||||||
|
Post-installation:
|
||||||
|
|
||||||
|
For Rails support, use
|
||||||
|
|
||||||
|
`script/generate jasmine`
|
||||||
|
|
||||||
|
For other projects, use
|
||||||
|
|
||||||
|
`jasmine init`
|
||||||
|
|
||||||
|
After initializing a project, you may
|
||||||
|
|
||||||
|
`rake jasmine`
|
||||||
|
|
||||||
|
to set up a server. Opening localhost:8888 in a web browser will now run your jasmine specs.
|
||||||
|
|
||||||
|
You may also
|
||||||
|
|
||||||
|
`rake jasmine:ci`
|
||||||
|
|
||||||
|
which will run your Jasmine suites using selenium and rspec. This task is suitable for running in continuous integration environments.
|
||||||
|
|
||||||
|
Simple Configuration:
|
||||||
|
|
||||||
|
Customize `spec/javascripts/support/jasmine.yaml` to enumerate the source files, stylesheets, and spec files you would like the Jasmine runner to include.
|
||||||
|
You may use dir glob strings.
|
||||||
|
|
||||||
|
It is also possible to add overrides into the `spec/javascripts/support/jasmine_config.rb` file directly if you require further customization.
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
<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)
|
|
||||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine?ref=badge_shield)
|
|
||||||
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
Documentation & guides live here: [http://jasmine.github.io](http://jasmine.github.io/)
|
|
||||||
For a quick start guide of Jasmine, see the beginning of [http://jasmine.github.io/edge/introduction.html](http://jasmine.github.io/edge/introduction.html).
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Please read the [contributors' guide](https://github.com/jasmine/jasmine/blob/main/.github/CONTRIBUTING.md).
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
For the Jasmine NPM module:<br>
|
|
||||||
[https://github.com/jasmine/jasmine-npm](https://github.com/jasmine/jasmine-npm).
|
|
||||||
|
|
||||||
For the Jasmine browser runner:<br>
|
|
||||||
[https://github.com/jasmine/jasmine-browser](https://github.com/jasmine/jasmine-browser).
|
|
||||||
|
|
||||||
For the Jasmine Ruby Gem:<br>
|
|
||||||
[https://github.com/jasmine/jasmine-gem](https://github.com/jasmine/jasmine-gem).
|
|
||||||
|
|
||||||
To install Jasmine standalone on your local box (where **_{#.#.#}_** below is substituted by the release number downloaded):
|
|
||||||
|
|
||||||
* Download the standalone distribution for your desired release from the [releases page](https://github.com/jasmine/jasmine/releases).
|
|
||||||
* Create a Jasmine directory in your project. - `mkdir my-project/jasmine`
|
|
||||||
* Move the dist to your project directory. - `mv jasmine/dist/jasmine-standalone-{#.#.#}.zip my-project/jasmine`
|
|
||||||
* Change directory. - `cd my-project/jasmine`
|
|
||||||
* Unzip the dist. - `unzip jasmine-standalone-{#.#.#}.zip`
|
|
||||||
|
|
||||||
Add the following to your HTML file:
|
|
||||||
|
|
||||||
```html
|
|
||||||
<link rel="shortcut icon" type="image/png" href="lib/jasmine-{#.#.#}/jasmine_favicon.png">
|
|
||||||
<link rel="stylesheet" type="text/css" href="lib/jasmine-{#.#.#}/jasmine.css">
|
|
||||||
|
|
||||||
<script type="text/javascript" src="lib/jasmine-{#.#.#}/jasmine.js"></script>
|
|
||||||
<script type="text/javascript" src="lib/jasmine-{#.#.#}/jasmine-html.js"></script>
|
|
||||||
<script type="text/javascript" src="lib/jasmine-{#.#.#}/boot.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Supported environments
|
|
||||||
|
|
||||||
Jasmine tests itself across many browsers (Safari, Chrome, Firefox, Microsoft Edge, and Internet Explorer) as well as nodejs.
|
|
||||||
|
|
||||||
| Environment | Supported versions |
|
|
||||||
|-------------------|--------------------|
|
|
||||||
| Node | 10, 12, 14, 16 |
|
|
||||||
| Safari | 8-14 |
|
|
||||||
| Chrome | Evergreen |
|
|
||||||
| Firefox | Evergreen, 68, 78 |
|
|
||||||
| Edge | Evergreen |
|
|
||||||
| Internet Explorer | 10, 11 |
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Support
|
|
||||||
|
|
||||||
* Search past discussions: [http://groups.google.com/group/jasmine-js](http://groups.google.com/group/jasmine-js).
|
|
||||||
* Send an email to the list: [jasmine-js@googlegroups.com](mailto:jasmine-js@googlegroups.com).
|
|
||||||
* View the project backlog at Pivotal Tracker: [http://www.pivotaltracker.com/projects/10606](http://www.pivotaltracker.com/projects/10606).
|
|
||||||
* Follow us on Twitter: [@JasmineBDD](http://twitter.com/JasmineBDD).
|
|
||||||
|
|
||||||
## Maintainers
|
|
||||||
|
|
||||||
* [Gregg Van Hove](mailto:gvanhove@pivotal.io), Pivotal Labs
|
|
||||||
|
|
||||||
### Maintainers Emeritus
|
|
||||||
|
|
||||||
* [Davis W. Frank](mailto:dwfrank@pivotal.io), Pivotal Labs
|
|
||||||
* [Rajan Agaskar](mailto:rajan@pivotal.io), Pivotal Labs
|
|
||||||
* [Greg Cobb](mailto:gcobb@pivotal.io), Pivotal Labs
|
|
||||||
* [Chris Amavisca](mailto:camavisca@pivotal.io), Pivotal Labs
|
|
||||||
* [Christian Williams](mailto:antixian666@gmail.com), Cloud Foundry
|
|
||||||
* Sheel Choksi
|
|
||||||
|
|
||||||
Copyright (c) 2008-2018 Pivotal Labs. This software is licensed under the MIT License.
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
|
||||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fjasmine%2Fjasmine?ref=badge_large)
|
|
||||||
-101
@@ -1,101 +0,0 @@
|
|||||||
# How to work on a Jasmine Release
|
|
||||||
|
|
||||||
## Development
|
|
||||||
___Jasmine Core Maintainers Only___
|
|
||||||
|
|
||||||
Follow the instructions in `CONTRIBUTING.md` during development.
|
|
||||||
|
|
||||||
### Git Rules
|
|
||||||
|
|
||||||
Please attempt to keep commits to `main` small, but cohesive. If a feature is contained in a bunch of small commits (e.g., it has several wip commits or small work), please squash them when pushing to `main`.
|
|
||||||
|
|
||||||
### Version
|
|
||||||
|
|
||||||
We attempt to stick to [Semantic Versioning](http://semver.org/). Most of the time, development should be against a new minor version - fixing bugs and adding new features that are backwards compatible.
|
|
||||||
|
|
||||||
The current version lives in the file `/package.json`. This version will be the version number that is currently released. When releasing a new version, update `package.json` with the new version and `grunt build:copyVersionToGem` to update the gem version number.
|
|
||||||
|
|
||||||
This version is used by both `jasmine.js` and the `jasmine-core` Ruby gem.
|
|
||||||
|
|
||||||
Note that Jasmine should only use the "patch" version number in the following cases:
|
|
||||||
|
|
||||||
* Changes related to packaging for a specific platform (npm, gem, or pip).
|
|
||||||
* Fixes for regressions.
|
|
||||||
|
|
||||||
When jasmine-core revs its major or minor version, the binding libraries should also rev to that version.
|
|
||||||
|
|
||||||
## Release
|
|
||||||
|
|
||||||
When ready to release - specs are all green and the stories are done:
|
|
||||||
|
|
||||||
1. Update the release notes in `release_notes` - use the Anchorman gem to generate the markdown file and edit accordingly. Include a list of supported environments.
|
|
||||||
1. Update the version in `package.json`
|
|
||||||
1. Run `npm run build`.
|
|
||||||
1. Copy version to the Ruby gem with `grunt build:copyVersionToGem`
|
|
||||||
|
|
||||||
### Commit and push core changes
|
|
||||||
|
|
||||||
1. Run the browser tests using `scripts/run-all-browsers`.
|
|
||||||
1. Commit release notes and version changes (jasmine.js, version.rb, package.json)
|
|
||||||
1. Push
|
|
||||||
1. Wait for Circle CI to go green
|
|
||||||
|
|
||||||
### Build standalone distribution
|
|
||||||
|
|
||||||
1. Build the standalone distribution with `grunt buildStandaloneDist`
|
|
||||||
1. This will generate `dist/jasmine-standalone-<version>.zip`, which you will upload later (see "Finally" below).
|
|
||||||
|
|
||||||
### Release the core Ruby gem
|
|
||||||
|
|
||||||
1. __NOTE__: You will likely need to push a new jasmine gem with a dependent version right after this release. See below.
|
|
||||||
1. `rake release` - tags the repo with the version, builds the `jasmine-core` gem, pushes the gem to Rubygems.org. In order to release you will have to ensure you have rubygems creds locally.
|
|
||||||
|
|
||||||
### Release the core Python egg
|
|
||||||
|
|
||||||
Install [twine](https://github.com/pypa/twine)
|
|
||||||
|
|
||||||
1. `python setup.py sdist`
|
|
||||||
1. `twine upload dist/jasmine-core-<version>.tar.gz` You will need pypi credentials to upload the egg.
|
|
||||||
|
|
||||||
### Release the core NPM module
|
|
||||||
|
|
||||||
1. Run the tests on Windows. (CI only tests on Linux.)
|
|
||||||
1. `npm adduser` to save your credentials locally
|
|
||||||
1. `npm publish .` to publish what's in `package.json`
|
|
||||||
|
|
||||||
### Release the docs
|
|
||||||
|
|
||||||
Probably only need to do this when releasing a minor version, and not a patch version.
|
|
||||||
|
|
||||||
1. `rake update_edge_jasmine`
|
|
||||||
1. `npm run jsdoc`
|
|
||||||
1. `rake release[${version}]` to copy the current edge docs to the new version
|
|
||||||
1. Commit and push.
|
|
||||||
|
|
||||||
### Release the binding libraries
|
|
||||||
|
|
||||||
#### NPM
|
|
||||||
|
|
||||||
1. Create release notes using Anchorman as above
|
|
||||||
1. In `package.json`, update both the package version and the jasmine-core dependency version
|
|
||||||
1. Commit and push.
|
|
||||||
1. Wait for Circle CI to go green again.
|
|
||||||
1. Run the tests on Windows locally.
|
|
||||||
1. `grunt release `. (Note: This will publish the package by running `npm publish`.)
|
|
||||||
|
|
||||||
#### Gem
|
|
||||||
|
|
||||||
1. Create release notes using Anchorman as above
|
|
||||||
1. Update the version number in `lib/jasmine/version.rb`.
|
|
||||||
1. Update the jasmine-core dependency version in `jasmine.gemspec`.
|
|
||||||
1. Commit and push.
|
|
||||||
1. Wait for Circle CI to go green again.
|
|
||||||
1. `rake release`
|
|
||||||
|
|
||||||
### Finally
|
|
||||||
|
|
||||||
For each of the above GitHub repos:
|
|
||||||
1. Visit the releases page and find the tag just published.
|
|
||||||
1. Paste in a link to the correct release notes for this release. The link should reference the blob and tag correctly, and the markdown file for the notes.
|
|
||||||
1. If it is a pre-release, mark it as such.
|
|
||||||
1. For core, attach the standalone zipfile.
|
|
||||||
@@ -1,2 +1,66 @@
|
|||||||
require "bundler"
|
require "#{File.dirname(__FILE__)}/vendor/gems/environment"
|
||||||
Bundler::GemHelper.install_tasks
|
Bundler.require_env :rake
|
||||||
|
|
||||||
|
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/lib")
|
||||||
|
|
||||||
|
require 'spec'
|
||||||
|
require 'spec/rake/spectask'
|
||||||
|
|
||||||
|
desc "Run all examples"
|
||||||
|
Spec::Rake::SpecTask.new('spec') do |t|
|
||||||
|
t.spec_files = FileList['spec/**/*.rb']
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :jasmine do
|
||||||
|
# require 'jasmine'
|
||||||
|
require 'spec/jasmine_self_test_config'
|
||||||
|
|
||||||
|
# desc "Run continuous integration tests"
|
||||||
|
# require "spec"
|
||||||
|
# require 'spec/rake/spectask'
|
||||||
|
# Spec::Rake::SpecTask.new(:ci) do |t|
|
||||||
|
# t.spec_opts = ["--color", "--format", "specdoc"]
|
||||||
|
# t.verbose = true
|
||||||
|
# t.spec_files = [JasmineHelper.meta_spec_path]
|
||||||
|
# end
|
||||||
|
|
||||||
|
task :server do
|
||||||
|
puts "your tests are here:"
|
||||||
|
puts " http://localhost:8888/run.html"
|
||||||
|
|
||||||
|
JasmineSelfTestConfig.new.start_server
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Run specs via server"
|
||||||
|
task :jasmine => ['jasmine:server']
|
||||||
|
|
||||||
|
|
||||||
|
namespace :jeweler do
|
||||||
|
|
||||||
|
unless File.exists?('jasmine/lib')
|
||||||
|
raise "Jasmine submodule isn't present. Run git submodule update --init"
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
require 'jeweler'
|
||||||
|
require 'rake'
|
||||||
|
Jeweler::Tasks.new do |gemspec|
|
||||||
|
gemspec.name = "jasmine"
|
||||||
|
gemspec.summary = "Jasmine Ruby Runner"
|
||||||
|
gemspec.description = "Javascript BDD test framework"
|
||||||
|
gemspec.email = "ragaskar@gmail.com"
|
||||||
|
gemspec.homepage = "http://github.com/pivotal/jasmine-ruby"
|
||||||
|
gemspec.authors = ["Rajan Agaskar", "Christian Williams"]
|
||||||
|
gemspec.executables = ["jasmine"]
|
||||||
|
gemspec.files = FileList.new('generators/**/**', 'lib/**/**', 'jasmine/lib/**', 'jasmine/contrib/ruby/**', 'tasks/**', 'templates/**')
|
||||||
|
gemspec.add_dependency('rspec', '>= 1.1.5')
|
||||||
|
gemspec.add_dependency('json', '>= 1.1.9')
|
||||||
|
gemspec.add_dependency('rack', '>= 1.0.0')
|
||||||
|
gemspec.add_dependency('thin', '>= 1.2.4')
|
||||||
|
gemspec.add_dependency('selenium-rc', '>=2.1.0')
|
||||||
|
gemspec.add_dependency('selenium-client', '>=1.2.17')
|
||||||
|
end
|
||||||
|
Jeweler::GemcutterTasks.new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
:patch: 6
|
||||||
|
:major: 0
|
||||||
|
:build:
|
||||||
|
:minor: 4
|
||||||
Executable
+58
@@ -0,0 +1,58 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
require 'rubygems'
|
||||||
|
require 'rake'
|
||||||
|
|
||||||
|
def cwd
|
||||||
|
File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
||||||
|
end
|
||||||
|
|
||||||
|
def expand(*paths)
|
||||||
|
File.expand_path(File.join(*paths))
|
||||||
|
end
|
||||||
|
|
||||||
|
def template_path(filepath)
|
||||||
|
expand(cwd, File.join("generators/jasmine/templates", filepath))
|
||||||
|
end
|
||||||
|
|
||||||
|
def dest_path(filepath)
|
||||||
|
expand(Dir.pwd, filepath)
|
||||||
|
end
|
||||||
|
|
||||||
|
def copy_unless_exists(relative_path, dest_path = nil)
|
||||||
|
unless File.exist?(dest_path(relative_path))
|
||||||
|
File.copy(template_path(relative_path), dest_path(dest_path || relative_path))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ARGV[0] == 'init'
|
||||||
|
require 'ftools'
|
||||||
|
File.makedirs('spec/javascripts')
|
||||||
|
File.makedirs('spec/javascripts/support')
|
||||||
|
|
||||||
|
copy_unless_exists('spec/javascripts/SpecHelper.js')
|
||||||
|
copy_unless_exists('spec/javascripts/ExampleSpec.js')
|
||||||
|
copy_unless_exists('spec/javascripts/support/jasmine_config.rb')
|
||||||
|
copy_unless_exists('spec/javascripts/support/jasmine_runner.rb')
|
||||||
|
|
||||||
|
rails_tasks_dir = dest_path('lib/tasks')
|
||||||
|
if File.exist?(rails_tasks_dir)
|
||||||
|
copy_unless_exists('lib/tasks/jasmine.rake')
|
||||||
|
copy_unless_exists('spec/javascripts/support/jasmine-rails.yml', 'spec/javascripts/support/jasmine.yml')
|
||||||
|
else
|
||||||
|
copy_unless_exists('spec/javascripts/support/jasmine.yml')
|
||||||
|
write_mode = 'w'
|
||||||
|
if File.exist?(dest_path('Rakefile'))
|
||||||
|
load dest_path('Rakefile')
|
||||||
|
write_mode = 'a'
|
||||||
|
end
|
||||||
|
unless Rake::Task.task_defined?('jasmine')
|
||||||
|
File.open(dest_path('Rakefile'), write_mode) do |f|
|
||||||
|
f.write(File.read(template_path('lib/tasks/jasmine.rake')))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
File.open(template_path('INSTALL'), 'r').each_line do |line|
|
||||||
|
puts line
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-40
@@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "jasmine-core",
|
|
||||||
"homepage": "https://jasmine.github.io",
|
|
||||||
"authors": [
|
|
||||||
"slackersoft <gregg@slackersoft.net>"
|
|
||||||
],
|
|
||||||
"description": "Official packaging of Jasmine's core files",
|
|
||||||
"keywords": [
|
|
||||||
"test",
|
|
||||||
"jasmine",
|
|
||||||
"tdd",
|
|
||||||
"bdd"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"moduleType": "globals",
|
|
||||||
"main": "lib/jasmine-core/jasmine.js",
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"dist",
|
|
||||||
"grunt",
|
|
||||||
"node_modules",
|
|
||||||
"pkg",
|
|
||||||
"release_notes",
|
|
||||||
"spec",
|
|
||||||
"src",
|
|
||||||
"Gemfile",
|
|
||||||
"Gemfile.lock",
|
|
||||||
"Rakefile",
|
|
||||||
"jasmine-core.gemspec",
|
|
||||||
"*.sh",
|
|
||||||
"*.py",
|
|
||||||
"Gruntfile.js",
|
|
||||||
"lib/jasmine-core.rb",
|
|
||||||
"lib/jasmine-core/boot/",
|
|
||||||
"lib/jasmine-core/spec",
|
|
||||||
"lib/jasmine-core/version.rb",
|
|
||||||
"lib/jasmine-core/*.py",
|
|
||||||
"sauce_connect.log"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
class JasmineGenerator < Rails::Generator::Base
|
||||||
|
def manifest
|
||||||
|
record do |m|
|
||||||
|
|
||||||
|
m.directory "spec/javascripts"
|
||||||
|
m.file "spec/javascripts/SpecHelper.js", "spec/javascripts/SpecHelper.js"
|
||||||
|
m.file "spec/javascripts/ExampleSpec.js", "spec/javascripts/ExampleSpec.js"
|
||||||
|
|
||||||
|
m.directory "spec/javascripts/support"
|
||||||
|
m.file "spec/javascripts/support/jasmine_config.rb", "spec/javascripts/support/jasmine_config.rb"
|
||||||
|
m.file "spec/javascripts/support/jasmine_runner.rb", "spec/javascripts/support/jasmine_runner.rb"
|
||||||
|
m.file "spec/javascripts/support/jasmine-rails.yml", "spec/javascripts/support/jasmine.yml"
|
||||||
|
|
||||||
|
m.directory "lib/tasks"
|
||||||
|
m.file "lib/tasks/jasmine.rake", "lib/tasks/jasmine.rake"
|
||||||
|
|
||||||
|
m.readme "INSTALL"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def file_name
|
||||||
|
"create_blog"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Jasmine has been installed with example specs.
|
||||||
|
|
||||||
|
To run the server:
|
||||||
|
|
||||||
|
rake jasmine
|
||||||
|
|
||||||
|
To run the automated CI task with Selenium:
|
||||||
|
|
||||||
|
rake jasmine:ci
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
namespace :jasmine do
|
||||||
|
require 'jasmine'
|
||||||
|
|
||||||
|
desc "Run continuous integration tests"
|
||||||
|
require "spec"
|
||||||
|
require 'spec/rake/spectask'
|
||||||
|
Spec::Rake::SpecTask.new(:ci) do |t|
|
||||||
|
t.spec_opts = ["--color", "--format", "specdoc"]
|
||||||
|
t.verbose = true
|
||||||
|
t.spec_files = ['spec/javascripts/support/jasmine_runner.rb']
|
||||||
|
end
|
||||||
|
task :server do
|
||||||
|
require 'spec/javascripts/support/jasmine_config'
|
||||||
|
|
||||||
|
puts "your tests are here:"
|
||||||
|
puts " http://localhost:8888/run.html"
|
||||||
|
|
||||||
|
Jasmine::Config.new.start_server
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Run specs via server"
|
||||||
|
task :jasmine => ['jasmine:server']
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
describe('Example', function () {
|
||||||
|
it('should have a passing test', function() {
|
||||||
|
expect(true).toEqual(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('nested describe', function () {
|
||||||
|
it('should also have a passing test', function () {
|
||||||
|
expect(true).toEqual(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
//You may load required files here, or create test-runner-wide environment settings.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
||||||
|
src_files:
|
||||||
|
- javascripts/prototype.js
|
||||||
|
- javascripts/effects.js
|
||||||
|
- javascripts/controls.js
|
||||||
|
- javascripts/dragdrop.js
|
||||||
|
- javascripts/application.js
|
||||||
|
|
||||||
|
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
|
||||||
|
stylesheets:
|
||||||
|
- stylesheets/**/*.css
|
||||||
|
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
||||||
|
spec_files:
|
||||||
|
- **/*.js
|
||||||
|
|
||||||
|
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
|
||||||
|
src_dir: public
|
||||||
|
|
||||||
|
# Spec directory path. Your spec_files must be returned relative to this path.
|
||||||
|
spec_dir: spec/javascripts
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
||||||
|
#src_files:
|
||||||
|
# - lib/source1.js
|
||||||
|
# - lib/source2.js
|
||||||
|
# - dist/**/*.js
|
||||||
|
|
||||||
|
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
|
||||||
|
#stylesheets:
|
||||||
|
# - css/style.css
|
||||||
|
# - stylesheets/*.css
|
||||||
|
|
||||||
|
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
||||||
|
#spec_files:
|
||||||
|
# - **/*.js
|
||||||
|
|
||||||
|
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
|
||||||
|
#src_dir:
|
||||||
|
|
||||||
|
# Spec directory path. Your spec_files must be returned relative to this path.
|
||||||
|
#spec_dir: spec/javascripts
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
require 'jasmine'
|
||||||
|
|
||||||
|
class Jasmine::Config
|
||||||
|
|
||||||
|
# Override these methods if necessary
|
||||||
|
|
||||||
|
# def project_root
|
||||||
|
# Dir.pwd
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Path to your jasmine.yml
|
||||||
|
# def simple_config_file
|
||||||
|
# File.join(project_root, 'spec/javascripts/support/jasmine.yml')
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Source directory path. Your src_files must be returned relative to this path.
|
||||||
|
# def src_dir
|
||||||
|
# if simple_config['src_dir']
|
||||||
|
# File.join(project_root, simple_config['src_dir'])
|
||||||
|
# else
|
||||||
|
# project_root
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Spec directory path. Your spec_files must be returned relative to this path.
|
||||||
|
# def spec_dir
|
||||||
|
# if simple_config['spec_dir']
|
||||||
|
# File.join(project_root, simple_config['spec_dir'])
|
||||||
|
# else
|
||||||
|
# File.join(project_root, 'spec/javascripts')
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
||||||
|
# def src_files
|
||||||
|
# files = []
|
||||||
|
# if simple_config['src_files']
|
||||||
|
# files = simple_config['src_files'].collect {|filepath| Dir.glob(filepath)}
|
||||||
|
# end
|
||||||
|
# files
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
||||||
|
# def spec_files
|
||||||
|
# files = match_files(spec_dir, "**/*.js")
|
||||||
|
# if simple_config['spec_files']
|
||||||
|
# files = simple_config['spec_files'].collect {|filepath| Dir.glob(filepath)}
|
||||||
|
# end
|
||||||
|
# files
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
||||||
|
# def stylesheets
|
||||||
|
# files = []
|
||||||
|
# if simple_config['stylesheets']
|
||||||
|
# files = simple_config['stylesheets'].collect {|filepath| Dir.glob(filepath)}
|
||||||
|
# end
|
||||||
|
# files
|
||||||
|
# end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
require 'rubygems'
|
||||||
|
require File.expand_path(File.join(File.dirname(__FILE__), 'jasmine_config'))
|
||||||
|
|
||||||
|
jasmine_config = Jasmine::Config.new
|
||||||
|
spec_builder = Jasmine::SpecBuilder.new(jasmine_config)
|
||||||
|
|
||||||
|
should_stop = false
|
||||||
|
|
||||||
|
Spec::Runner.configure do |config|
|
||||||
|
config.after(:suite) do
|
||||||
|
spec_builder.stop if should_stop
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
spec_builder.start
|
||||||
|
should_stop = true
|
||||||
|
spec_builder.declare_suites
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
var standaloneLibDir = "lib/jasmine-" + jasmineVersion;
|
|
||||||
|
|
||||||
function root(path) { return "./" + path; }
|
|
||||||
function libJasmineCore(path) { return root("lib/jasmine-core/" + path); }
|
|
||||||
function dist(path) { return root("dist/" + path); }
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
standalone: {
|
|
||||||
options: {
|
|
||||||
archive: root("dist/jasmine-standalone-" + global.jasmineVersion + ".zip")
|
|
||||||
},
|
|
||||||
|
|
||||||
files: [
|
|
||||||
{ src: [ root("MIT.LICENSE") ] },
|
|
||||||
{
|
|
||||||
src: [ "jasmine_favicon.png"],
|
|
||||||
dest: standaloneLibDir,
|
|
||||||
expand: true,
|
|
||||||
cwd: root("images")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: [
|
|
||||||
"jasmine.js",
|
|
||||||
"jasmine-html.js",
|
|
||||||
"jasmine.css"
|
|
||||||
],
|
|
||||||
dest: standaloneLibDir,
|
|
||||||
expand: true,
|
|
||||||
cwd: libJasmineCore("")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: [ "boot.js" ],
|
|
||||||
dest: standaloneLibDir,
|
|
||||||
expand: true,
|
|
||||||
cwd: libJasmineCore("boot")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: [ "SpecRunner.html" ],
|
|
||||||
dest: root(""),
|
|
||||||
expand: true,
|
|
||||||
cwd: dist("tmp")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: [ "*.js" ],
|
|
||||||
dest: "src",
|
|
||||||
expand: true,
|
|
||||||
cwd: libJasmineCore("example/src/")
|
|
||||||
},
|
|
||||||
{
|
|
||||||
src: [ "*.js" ],
|
|
||||||
dest: "spec",
|
|
||||||
expand: true,
|
|
||||||
cwd: libJasmineCore("example/spec/")
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
var grunt = require('grunt');
|
|
||||||
|
|
||||||
function license() {
|
|
||||||
var currentYear = "" + new Date(Date.now()).getFullYear();
|
|
||||||
|
|
||||||
return grunt.template.process(
|
|
||||||
grunt.file.read("grunt/templates/licenseBanner.js.jst"),
|
|
||||||
{ data: { currentYear: currentYear}});
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
'jasmine-html': {
|
|
||||||
src: [
|
|
||||||
'src/html/requireHtml.js',
|
|
||||||
'src/html/HtmlReporter.js',
|
|
||||||
'src/html/HtmlSpecFilter.js',
|
|
||||||
'src/html/ResultsNode.js',
|
|
||||||
'src/html/QueryString.js',
|
|
||||||
'src/html/**/*.js'
|
|
||||||
],
|
|
||||||
dest: 'lib/jasmine-core/jasmine-html.js'
|
|
||||||
},
|
|
||||||
jasmine: {
|
|
||||||
src: [
|
|
||||||
'src/core/requireCore.js',
|
|
||||||
'src/core/matchers/requireMatchers.js',
|
|
||||||
'src/core/base.js',
|
|
||||||
'src/core/util.js',
|
|
||||||
'src/core/Spec.js',
|
|
||||||
'src/core/Order.js',
|
|
||||||
'src/core/Env.js',
|
|
||||||
'src/core/JsApiReporter.js',
|
|
||||||
'src/core/PrettyPrinter',
|
|
||||||
'src/core/Suite',
|
|
||||||
'src/core/**/*.js',
|
|
||||||
'src/version.js'
|
|
||||||
],
|
|
||||||
dest: 'lib/jasmine-core/jasmine.js'
|
|
||||||
},
|
|
||||||
boot: {
|
|
||||||
src: ['lib/jasmine-core/boot/boot.js'],
|
|
||||||
dest: 'lib/jasmine-core/boot.js'
|
|
||||||
},
|
|
||||||
nodeBoot: {
|
|
||||||
src: ['lib/jasmine-core/boot/node_boot.js'],
|
|
||||||
dest: 'lib/jasmine-core/node_boot.js'
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
banner: license(),
|
|
||||||
process: {
|
|
||||||
data: {
|
|
||||||
version: global.jasmineVersion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
encodeWithBaseDir: {
|
|
||||||
files: {
|
|
||||||
"lib/jasmine-core/jasmine.css": ["lib/jasmine-core/jasmine.css"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
const sass = require('sass');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
options: {
|
|
||||||
implementation: sass,
|
|
||||||
sourceComments: false
|
|
||||||
},
|
|
||||||
dist: {
|
|
||||||
files: {
|
|
||||||
"lib/jasmine-core/jasmine.css": "src/html/jasmine.scss"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
var grunt = require("grunt");
|
|
||||||
|
|
||||||
function standaloneTmpDir(path) { return "dist/tmp/" + path; }
|
|
||||||
|
|
||||||
grunt.registerTask("build:compileSpecRunner",
|
|
||||||
"Processes the spec runner template and writes to a tmp file",
|
|
||||||
function() {
|
|
||||||
var runnerHtml = grunt.template.process(
|
|
||||||
grunt.file.read("grunt/templates/SpecRunner.html.jst"),
|
|
||||||
{ data: { jasmineVersion: global.jasmineVersion }});
|
|
||||||
|
|
||||||
grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
grunt.registerTask("build:cleanSpecRunner",
|
|
||||||
"Deletes the tmp spec runner file",
|
|
||||||
function() {
|
|
||||||
grunt.file.delete(standaloneTmpDir(""));
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
grunt.registerTask("buildStandaloneDist",
|
|
||||||
"Builds a standalone distribution",
|
|
||||||
[
|
|
||||||
"buildDistribution",
|
|
||||||
"build:compileSpecRunner",
|
|
||||||
"compress:standalone",
|
|
||||||
"build:cleanSpecRunner"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
var grunt = require("grunt");
|
|
||||||
|
|
||||||
function gemLib(path) { return './lib/jasmine-core/' + path; }
|
|
||||||
function nodeToRuby(version) { return version.replace('-', '.'); }
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
copyToGem: function() {
|
|
||||||
var versionRb = grunt.template.process(
|
|
||||||
grunt.file.read("grunt/templates/version.rb.jst"),
|
|
||||||
{ data: { jasmineVersion: nodeToRuby(global.jasmineVersion) }});
|
|
||||||
|
|
||||||
grunt.file.write(gemLib("version.rb"), versionRb);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Jasmine Spec Runner v<%= jasmineVersion %></title>
|
|
||||||
|
|
||||||
<link rel="shortcut icon" type="image/png" href="lib/jasmine-<%= jasmineVersion %>/jasmine_favicon.png">
|
|
||||||
<link rel="stylesheet" href="lib/jasmine-<%= jasmineVersion %>/jasmine.css">
|
|
||||||
|
|
||||||
<script src="lib/jasmine-<%= jasmineVersion %>/jasmine.js"></script>
|
|
||||||
<script src="lib/jasmine-<%= jasmineVersion %>/jasmine-html.js"></script>
|
|
||||||
<script src="lib/jasmine-<%= jasmineVersion %>/boot.js"></script>
|
|
||||||
|
|
||||||
<!-- include source files here... -->
|
|
||||||
<script src="src/Player.js"></script>
|
|
||||||
<script src="src/Song.js"></script>
|
|
||||||
|
|
||||||
<!-- include spec files here... -->
|
|
||||||
<script src="spec/SpecHelper.js"></script>
|
|
||||||
<script src="spec/PlayerSpec.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2008-<%= currentYear %> 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.
|
|
||||||
*/
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#
|
|
||||||
# DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
|
|
||||||
# by a grunt task when the standalone release is built.
|
|
||||||
#
|
|
||||||
module Jasmine
|
|
||||||
module Core
|
|
||||||
VERSION = "<%= jasmineVersion %>"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,102 +0,0 @@
|
|||||||
<?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>
|
|
||||||
|
Before Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,2 @@
|
|||||||
|
jasmine_bin = File.expand_path(File.join(File.dirname(__FILE__), 'bin', 'jasmine'))
|
||||||
|
`#{jasmine_bin} init`
|
||||||
Submodule
+1
Submodule jasmine added at 0bb7f4bd6a
@@ -1,19 +0,0 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
|
||||||
$:.push File.expand_path("../lib", __FILE__)
|
|
||||||
require "jasmine-core/version"
|
|
||||||
|
|
||||||
Gem::Specification.new do |s|
|
|
||||||
s.name = "jasmine-core"
|
|
||||||
s.version = Jasmine::Core::VERSION
|
|
||||||
s.platform = Gem::Platform::RUBY
|
|
||||||
s.authors = ["Gregg Van Hove"]
|
|
||||||
s.summary = %q{JavaScript BDD framework}
|
|
||||||
s.description = %q{Test your JavaScript without any framework dependencies, in any environment, and with a nice descriptive syntax.}
|
|
||||||
s.email = %q{jasmine-js@googlegroups.com}
|
|
||||||
s.homepage = "http://jasmine.github.io"
|
|
||||||
s.license = "MIT"
|
|
||||||
|
|
||||||
s.files = Dir.glob("./lib/**/*")
|
|
||||||
s.require_paths = ["lib"]
|
|
||||||
s.add_development_dependency "rake"
|
|
||||||
end
|
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
# Generated by jeweler
|
||||||
|
# DO NOT EDIT THIS FILE DIRECTLY
|
||||||
|
# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
|
||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
|
Gem::Specification.new do |s|
|
||||||
|
s.name = %q{jasmine}
|
||||||
|
s.version = "0.4.6"
|
||||||
|
|
||||||
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||||
|
s.authors = ["Rajan Agaskar", "Christian Williams"]
|
||||||
|
s.date = %q{2010-03-10}
|
||||||
|
s.default_executable = %q{jasmine}
|
||||||
|
s.description = %q{Javascript BDD test framework}
|
||||||
|
s.email = %q{ragaskar@gmail.com}
|
||||||
|
s.executables = ["jasmine"]
|
||||||
|
s.extra_rdoc_files = [
|
||||||
|
"README.markdown"
|
||||||
|
]
|
||||||
|
s.files = [
|
||||||
|
"generators/jasmine/jasmine_generator.rb",
|
||||||
|
"generators/jasmine/templates/INSTALL",
|
||||||
|
"generators/jasmine/templates/lib/tasks/jasmine.rake",
|
||||||
|
"generators/jasmine/templates/spec/javascripts/ExampleSpec.js",
|
||||||
|
"generators/jasmine/templates/spec/javascripts/SpecHelper.js",
|
||||||
|
"generators/jasmine/templates/spec/javascripts/support/jasmine-rails.yml",
|
||||||
|
"generators/jasmine/templates/spec/javascripts/support/jasmine.yml",
|
||||||
|
"generators/jasmine/templates/spec/javascripts/support/jasmine_config.rb",
|
||||||
|
"generators/jasmine/templates/spec/javascripts/support/jasmine_runner.rb",
|
||||||
|
"jasmine/contrib/ruby/jasmine_runner.rb",
|
||||||
|
"jasmine/contrib/ruby/jasmine_spec_builder.rb",
|
||||||
|
"jasmine/contrib/ruby/run.html",
|
||||||
|
"jasmine/lib/TrivialReporter.js",
|
||||||
|
"jasmine/lib/consolex.js",
|
||||||
|
"jasmine/lib/jasmine-0.10.1.js",
|
||||||
|
"jasmine/lib/jasmine.css",
|
||||||
|
"jasmine/lib/json2.js",
|
||||||
|
"lib/jasmine.rb",
|
||||||
|
"lib/jasmine/base.rb",
|
||||||
|
"lib/jasmine/config.rb",
|
||||||
|
"lib/jasmine/run.html.erb",
|
||||||
|
"lib/jasmine/selenium_driver.rb",
|
||||||
|
"lib/jasmine/server.rb",
|
||||||
|
"lib/jasmine/spec_builder.rb"
|
||||||
|
]
|
||||||
|
s.homepage = %q{http://github.com/pivotal/jasmine-ruby}
|
||||||
|
s.rdoc_options = ["--charset=UTF-8"]
|
||||||
|
s.require_paths = ["lib"]
|
||||||
|
s.rubygems_version = %q{1.3.5}
|
||||||
|
s.summary = %q{Jasmine Ruby Runner}
|
||||||
|
s.test_files = [
|
||||||
|
"spec/config_spec.rb",
|
||||||
|
"spec/jasmine_self_test_config.rb",
|
||||||
|
"spec/jasmine_self_test_spec.rb",
|
||||||
|
"spec/server_spec.rb",
|
||||||
|
"spec/spec_helper.rb"
|
||||||
|
]
|
||||||
|
|
||||||
|
if s.respond_to? :specification_version then
|
||||||
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
||||||
|
s.specification_version = 3
|
||||||
|
|
||||||
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
||||||
|
s.add_runtime_dependency(%q<rspec>, [">= 1.1.5"])
|
||||||
|
s.add_runtime_dependency(%q<json>, [">= 1.1.9"])
|
||||||
|
s.add_runtime_dependency(%q<rack>, [">= 1.0.0"])
|
||||||
|
s.add_runtime_dependency(%q<thin>, [">= 1.2.4"])
|
||||||
|
s.add_runtime_dependency(%q<selenium-rc>, [">= 2.1.0"])
|
||||||
|
s.add_runtime_dependency(%q<selenium-client>, [">= 1.2.17"])
|
||||||
|
else
|
||||||
|
s.add_dependency(%q<rspec>, [">= 1.1.5"])
|
||||||
|
s.add_dependency(%q<json>, [">= 1.1.9"])
|
||||||
|
s.add_dependency(%q<rack>, [">= 1.0.0"])
|
||||||
|
s.add_dependency(%q<thin>, [">= 1.2.4"])
|
||||||
|
s.add_dependency(%q<selenium-rc>, [">= 2.1.0"])
|
||||||
|
s.add_dependency(%q<selenium-client>, [">= 1.2.17"])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
s.add_dependency(%q<rspec>, [">= 1.1.5"])
|
||||||
|
s.add_dependency(%q<json>, [">= 1.1.9"])
|
||||||
|
s.add_dependency(%q<rack>, [">= 1.0.0"])
|
||||||
|
s.add_dependency(%q<thin>, [">= 1.2.4"])
|
||||||
|
s.add_dependency(%q<selenium-rc>, [">= 2.1.0"])
|
||||||
|
s.add_dependency(%q<selenium-client>, [">= 1.2.17"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
module.exports = require("./jasmine-core/jasmine.js");
|
|
||||||
module.exports.boot = require('./jasmine-core/node_boot.js');
|
|
||||||
|
|
||||||
var path = require('path'),
|
|
||||||
fs = require('fs');
|
|
||||||
|
|
||||||
var rootPath = path.join(__dirname, "jasmine-core"),
|
|
||||||
bootFiles = ['boot.js'],
|
|
||||||
nodeBootFiles = ['node_boot.js'],
|
|
||||||
cssFiles = [],
|
|
||||||
jsFiles = [],
|
|
||||||
jsFilesToSkip = ['jasmine.js'].concat(bootFiles, 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')
|
|
||||||
};
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
module Jasmine
|
|
||||||
module Core
|
|
||||||
class << self
|
|
||||||
def path
|
|
||||||
File.join(File.dirname(__FILE__), "jasmine-core")
|
|
||||||
end
|
|
||||||
|
|
||||||
def js_files
|
|
||||||
(["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq - boot_files - node_boot_files
|
|
||||||
end
|
|
||||||
|
|
||||||
SPEC_TYPES = ["core", "html", "node"]
|
|
||||||
|
|
||||||
def core_spec_files
|
|
||||||
spec_files("core")
|
|
||||||
end
|
|
||||||
|
|
||||||
def html_spec_files
|
|
||||||
spec_files("html")
|
|
||||||
end
|
|
||||||
|
|
||||||
def node_spec_files
|
|
||||||
spec_files("node")
|
|
||||||
end
|
|
||||||
|
|
||||||
def boot_files
|
|
||||||
["boot.js"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def node_boot_files
|
|
||||||
["node_boot.js"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def boot_dir
|
|
||||||
path
|
|
||||||
end
|
|
||||||
|
|
||||||
def spec_files(type)
|
|
||||||
raise ArgumentError.new("Unrecognized spec type") unless SPEC_TYPES.include?(type)
|
|
||||||
(Dir.glob(File.join(path, "spec", type, "*.js"))).map { |f| File.join("spec", type, File.basename(f)) }.uniq
|
|
||||||
end
|
|
||||||
|
|
||||||
def css_files
|
|
||||||
Dir.glob(File.join(path, "*.css")).map { |f| File.basename(f) }
|
|
||||||
end
|
|
||||||
|
|
||||||
def images_dir
|
|
||||||
File.join(File.dirname(__FILE__), '../images')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
from .core import Core
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2008-2021 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.
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
Starting with version 2.0, this file "boots" 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 `jasmine.js` and `jasmine_html.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 a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
|
|
||||||
|
|
||||||
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
|
|
||||||
|
|
||||||
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var 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.
|
|
||||||
*/
|
|
||||||
var 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.
|
|
||||||
*/
|
|
||||||
var 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.
|
|
||||||
*/
|
|
||||||
var 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`.
|
|
||||||
*/
|
|
||||||
extend(global, jasmineInterface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ## 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var queryString = new jasmine.QueryString({
|
|
||||||
getWindowLocation: function() { return window.location; }
|
|
||||||
});
|
|
||||||
|
|
||||||
var filterSpecs = !!queryString.getParam("spec");
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
failFast: queryString.getParam("failFast"),
|
|
||||||
oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
|
|
||||||
hideDisabled: queryString.getParam("hideDisabled")
|
|
||||||
};
|
|
||||||
|
|
||||||
var random = queryString.getParam("random");
|
|
||||||
|
|
||||||
if (random !== undefined && random !== "") {
|
|
||||||
config.random = random;
|
|
||||||
}
|
|
||||||
|
|
||||||
var 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).
|
|
||||||
*/
|
|
||||||
var 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(jasmineInterface.jsApiReporter);
|
|
||||||
env.addReporter(htmlReporter);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
|
||||||
*/
|
|
||||||
var specFilter = new jasmine.HtmlSpecFilter({
|
|
||||||
filterString: function() { return queryString.getParam("spec"); }
|
|
||||||
});
|
|
||||||
|
|
||||||
config.specFilter = function(spec) {
|
|
||||||
return specFilter.matches(spec.getFullName());
|
|
||||||
};
|
|
||||||
|
|
||||||
env.configure(config);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
|
|
||||||
*/
|
|
||||||
window.setTimeout = window.setTimeout;
|
|
||||||
window.setInterval = window.setInterval;
|
|
||||||
window.clearTimeout = window.clearTimeout;
|
|
||||||
window.clearInterval = window.clearInterval;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ## 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.
|
|
||||||
*/
|
|
||||||
var currentWindowOnload = window.onload;
|
|
||||||
|
|
||||||
window.onload = function() {
|
|
||||||
if (currentWindowOnload) {
|
|
||||||
currentWindowOnload();
|
|
||||||
}
|
|
||||||
htmlReporter.initialize();
|
|
||||||
env.execute();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper function for readability above.
|
|
||||||
*/
|
|
||||||
function extend(destination, source) {
|
|
||||||
for (var property in source) destination[property] = source[property];
|
|
||||||
return destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
/**
|
|
||||||
Starting with version 2.0, this file "boots" 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 `jasmine.js` and `jasmine_html.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 a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
|
|
||||||
|
|
||||||
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
|
|
||||||
|
|
||||||
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
var 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.
|
|
||||||
*/
|
|
||||||
var 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.
|
|
||||||
*/
|
|
||||||
var 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.
|
|
||||||
*/
|
|
||||||
var 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`.
|
|
||||||
*/
|
|
||||||
extend(global, jasmineInterface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ## 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var queryString = new jasmine.QueryString({
|
|
||||||
getWindowLocation: function() { return window.location; }
|
|
||||||
});
|
|
||||||
|
|
||||||
var filterSpecs = !!queryString.getParam("spec");
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
failFast: queryString.getParam("failFast"),
|
|
||||||
oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
|
|
||||||
hideDisabled: queryString.getParam("hideDisabled")
|
|
||||||
};
|
|
||||||
|
|
||||||
var random = queryString.getParam("random");
|
|
||||||
|
|
||||||
if (random !== undefined && random !== "") {
|
|
||||||
config.random = random;
|
|
||||||
}
|
|
||||||
|
|
||||||
var 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).
|
|
||||||
*/
|
|
||||||
var 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(jasmineInterface.jsApiReporter);
|
|
||||||
env.addReporter(htmlReporter);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
|
|
||||||
*/
|
|
||||||
var specFilter = new jasmine.HtmlSpecFilter({
|
|
||||||
filterString: function() { return queryString.getParam("spec"); }
|
|
||||||
});
|
|
||||||
|
|
||||||
config.specFilter = function(spec) {
|
|
||||||
return specFilter.matches(spec.getFullName());
|
|
||||||
};
|
|
||||||
|
|
||||||
env.configure(config);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
|
|
||||||
*/
|
|
||||||
window.setTimeout = window.setTimeout;
|
|
||||||
window.setInterval = window.setInterval;
|
|
||||||
window.clearTimeout = window.clearTimeout;
|
|
||||||
window.clearInterval = window.clearInterval;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ## 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.
|
|
||||||
*/
|
|
||||||
var currentWindowOnload = window.onload;
|
|
||||||
|
|
||||||
window.onload = function() {
|
|
||||||
if (currentWindowOnload) {
|
|
||||||
currentWindowOnload();
|
|
||||||
}
|
|
||||||
htmlReporter.initialize();
|
|
||||||
env.execute();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper function for readability above.
|
|
||||||
*/
|
|
||||||
function extend(destination, source) {
|
|
||||||
for (var property in source) destination[property] = source[property];
|
|
||||||
return destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
module.exports = function(jasmineRequire) {
|
|
||||||
var jasmine = jasmineRequire.core(jasmineRequire);
|
|
||||||
|
|
||||||
var env = jasmine.getEnv({suppressLoadErrors: true});
|
|
||||||
|
|
||||||
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
|
||||||
|
|
||||||
extend(global, jasmineInterface);
|
|
||||||
|
|
||||||
function extend(destination, source) {
|
|
||||||
for (var property in source) destination[property] = source[property];
|
|
||||||
return destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
return jasmine;
|
|
||||||
};
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
import pkg_resources
|
|
||||||
import os
|
|
||||||
|
|
||||||
if 'SUPPRESS_JASMINE_DEPRECATION' not in os.environ:
|
|
||||||
print('DEPRECATION WARNING:\n' +
|
|
||||||
'\n' +
|
|
||||||
'The Jasmine packages for Python are deprecated. There will be no further\n' +
|
|
||||||
'releases after the end of the Jasmine 3.x series. We recommend migrating to the\n' +
|
|
||||||
'following options:\n' +
|
|
||||||
'\n' +
|
|
||||||
'* jasmine-browser-runner (<https://github.com/jasmine/jasmine-browser>,\n' +
|
|
||||||
' `npm install jasmine-browser-runner`) to run specs in browsers, including\n' +
|
|
||||||
' headless Chrome and Saucelabs. This is the most direct replacement for the\n' +
|
|
||||||
' jasmine server` and `jasmine ci` commands provided by the `jasmine` Python\n' +
|
|
||||||
' package.\n' +
|
|
||||||
'* The jasmine npm package (<https://github.com/jasmine/jasmine-npm>,\n' +
|
|
||||||
' `npm install jasmine`) to run specs under Node.js.\n' +
|
|
||||||
'* The standalone distribution from the latest Jasmine release\n' +
|
|
||||||
' <https://github.com/jasmine/jasmine/releases> to run specs in browsers with\n' +
|
|
||||||
' no additional tools.\n' +
|
|
||||||
'* The jasmine-core npm package (`npm install jasmine-core`) if all you need is\n' +
|
|
||||||
' the Jasmine assets. This is the direct equivalent of the jasmine-core Python\n' +
|
|
||||||
' package.\n' +
|
|
||||||
'\n' +
|
|
||||||
'Except for the standalone distribution, all of the above are distributed through\n' +
|
|
||||||
'npm.\n' +
|
|
||||||
'\n' +
|
|
||||||
'To prevent this message from appearing, set the SUPPRESS_JASMINE_DEPRECATION\n' +
|
|
||||||
'environment variable.\n')
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
from collections import OrderedDict
|
|
||||||
except ImportError:
|
|
||||||
from ordereddict import OrderedDict
|
|
||||||
|
|
||||||
class Core(object):
|
|
||||||
@classmethod
|
|
||||||
def js_package(cls):
|
|
||||||
return __package__
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def css_package(cls):
|
|
||||||
return __package__
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def image_package(cls):
|
|
||||||
return __package__ + ".images"
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def js_files(cls):
|
|
||||||
js_files = sorted(list(filter(lambda x: '.js' in x, pkg_resources.resource_listdir(cls.js_package(), '.'))))
|
|
||||||
|
|
||||||
# jasmine.js needs to be first
|
|
||||||
js_files.insert(0, 'jasmine.js')
|
|
||||||
|
|
||||||
# boot needs to be last
|
|
||||||
js_files.remove('boot.js')
|
|
||||||
js_files.append('boot.js')
|
|
||||||
|
|
||||||
return cls._uniq(js_files)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def css_files(cls):
|
|
||||||
return cls._uniq(sorted(filter(lambda x: '.css' in x, pkg_resources.resource_listdir(cls.css_package(), '.'))))
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def favicon(cls):
|
|
||||||
return 'jasmine_favicon.png'
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _uniq(self, items, idfun=None):
|
|
||||||
# order preserving
|
|
||||||
|
|
||||||
if idfun is None:
|
|
||||||
def idfun(x): return x
|
|
||||||
seen = {}
|
|
||||||
result = []
|
|
||||||
for item in items:
|
|
||||||
marker = idfun(item)
|
|
||||||
# in old Python versions:
|
|
||||||
# if seen.has_key(marker)
|
|
||||||
# but in new ones:
|
|
||||||
if marker in seen:
|
|
||||||
continue
|
|
||||||
|
|
||||||
seen[marker] = 1
|
|
||||||
result.append(item)
|
|
||||||
return result
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
function Player() {
|
|
||||||
}
|
|
||||||
Player.prototype.play = function(song) {
|
|
||||||
this.currentlyPlayingSong = song;
|
|
||||||
this.isPlaying = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
Player.prototype.pause = function() {
|
|
||||||
this.isPlaying = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
Player.prototype.resume = function() {
|
|
||||||
if (this.isPlaying) {
|
|
||||||
throw new Error("song is already playing");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isPlaying = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
Player.prototype.makeFavorite = function() {
|
|
||||||
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Player;
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
function Song() {
|
|
||||||
}
|
|
||||||
|
|
||||||
Song.prototype.persistFavoriteStatus = function(value) {
|
|
||||||
// something complicated
|
|
||||||
throw new Error("not yet implemented");
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Song;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
beforeEach(function () {
|
|
||||||
jasmine.addMatchers({
|
|
||||||
toBePlaying: function () {
|
|
||||||
return {
|
|
||||||
compare: function (actual, expected) {
|
|
||||||
var player = actual;
|
|
||||||
|
|
||||||
return {
|
|
||||||
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
describe("Player", function() {
|
|
||||||
var Player = require('../../lib/jasmine_examples/Player');
|
|
||||||
var Song = require('../../lib/jasmine_examples/Song');
|
|
||||||
var player;
|
|
||||||
var 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");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
describe("Player", function() {
|
|
||||||
var player;
|
|
||||||
var 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");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
beforeEach(function () {
|
|
||||||
jasmine.addMatchers({
|
|
||||||
toBePlaying: function () {
|
|
||||||
return {
|
|
||||||
compare: function (actual, expected) {
|
|
||||||
var player = actual;
|
|
||||||
|
|
||||||
return {
|
|
||||||
pass: player.currentlyPlayingSong === expected && player.isPlaying
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
function Player() {
|
|
||||||
}
|
|
||||||
Player.prototype.play = function(song) {
|
|
||||||
this.currentlyPlayingSong = song;
|
|
||||||
this.isPlaying = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
Player.prototype.pause = function() {
|
|
||||||
this.isPlaying = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
Player.prototype.resume = function() {
|
|
||||||
if (this.isPlaying) {
|
|
||||||
throw new Error("song is already playing");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isPlaying = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
Player.prototype.makeFavorite = function() {
|
|
||||||
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
|
||||||
};
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
function Song() {
|
|
||||||
}
|
|
||||||
|
|
||||||
Song.prototype.persistFavoriteStatus = function(value) {
|
|
||||||
// something complicated
|
|
||||||
throw new Error("not yet implemented");
|
|
||||||
};
|
|
||||||
@@ -1,853 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2008-2021 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.
|
|
||||||
*/
|
|
||||||
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++;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function HtmlReporter(options) {
|
|
||||||
var config = function() {
|
|
||||||
return (options.env && options.env.configuration()) || {};
|
|
||||||
},
|
|
||||||
getContainer = options.getContainer,
|
|
||||||
createElement = options.createElement,
|
|
||||||
createTextNode = options.createTextNode,
|
|
||||||
navigateWithNewParam = options.navigateWithNewParam || function() {},
|
|
||||||
addToExistingQueryString =
|
|
||||||
options.addToExistingQueryString || defaultQueryString,
|
|
||||||
filterSpecs = options.filterSpecs,
|
|
||||||
htmlReporterMain,
|
|
||||||
symbols,
|
|
||||||
deprecationWarnings = [];
|
|
||||||
|
|
||||||
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);
|
|
||||||
};
|
|
||||||
|
|
||||||
var totalSpecsDefined;
|
|
||||||
this.jasmineStarted = function(options) {
|
|
||||||
totalSpecsDefined = options.totalSpecsDefined || 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
var summary = createDom('div', { className: 'jasmine-summary' });
|
|
||||||
|
|
||||||
var 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);
|
|
||||||
};
|
|
||||||
|
|
||||||
var failures = [];
|
|
||||||
this.specDone = function(result) {
|
|
||||||
stateBuilder.specDone(result);
|
|
||||||
|
|
||||||
if (noExpectations(result)) {
|
|
||||||
var 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) {
|
|
||||||
var banner = find('.jasmine-banner');
|
|
||||||
var alert = find('.jasmine-alert');
|
|
||||||
var order = doneResult && doneResult.order;
|
|
||||||
var i;
|
|
||||||
alert.appendChild(
|
|
||||||
createDom(
|
|
||||||
'span',
|
|
||||||
{ className: 'jasmine-duration' },
|
|
||||||
'finished in ' + doneResult.totalTime / 1000 + 's'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
banner.appendChild(optionsMenu(config()));
|
|
||||||
|
|
||||||
if (stateBuilder.specsExecuted < totalSpecsDefined) {
|
|
||||||
var 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
|
|
||||||
var skippedLink =
|
|
||||||
(window.location.pathname || '') +
|
|
||||||
addToExistingQueryString('spec', '');
|
|
||||||
alert.appendChild(
|
|
||||||
createDom(
|
|
||||||
'span',
|
|
||||||
{ className: 'jasmine-bar jasmine-skipped' },
|
|
||||||
createDom(
|
|
||||||
'a',
|
|
||||||
{ href: skippedLink, title: 'Run all specs' },
|
|
||||||
skippedMessage
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
var statusBarMessage = '';
|
|
||||||
var statusBarClassName = 'jasmine-overall-result jasmine-bar ';
|
|
||||||
var globalFailures = (doneResult && doneResult.failedExpectations) || [];
|
|
||||||
var 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 ';
|
|
||||||
}
|
|
||||||
|
|
||||||
var 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
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var errorBarClassName = 'jasmine-bar jasmine-errored';
|
|
||||||
var afterAllMessagePrefix = 'AfterAll ';
|
|
||||||
|
|
||||||
for (i = 0; i < globalFailures.length; i++) {
|
|
||||||
alert.appendChild(
|
|
||||||
createDom(
|
|
||||||
'span',
|
|
||||||
{ className: errorBarClassName },
|
|
||||||
globalFailureMessage(globalFailures[i])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function globalFailureMessage(failure) {
|
|
||||||
if (failure.globalErrorType === 'load') {
|
|
||||||
var prefix = 'Error during loading: ' + failure.message;
|
|
||||||
|
|
||||||
if (failure.filename) {
|
|
||||||
return (
|
|
||||||
prefix + ' in ' + failure.filename + ' line ' + failure.lineno
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return prefix;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return afterAllMessagePrefix + failure.message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addDeprecationWarnings(doneResult);
|
|
||||||
|
|
||||||
for (i = 0; i < deprecationWarnings.length; i++) {
|
|
||||||
var 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 = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
alert.appendChild(
|
|
||||||
createDom(
|
|
||||||
'span',
|
|
||||||
{ className: 'jasmine-bar jasmine-warning' },
|
|
||||||
'DEPRECATION: ' + deprecationWarnings[i].message,
|
|
||||||
createDom('br'),
|
|
||||||
context
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
var 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');
|
|
||||||
|
|
||||||
var failureNode = find('.jasmine-failures');
|
|
||||||
for (i = 0; i < failures.length; i++) {
|
|
||||||
failureNode.appendChild(failures[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return this;
|
|
||||||
|
|
||||||
function failureDom(result) {
|
|
||||||
var failure = createDom(
|
|
||||||
'div',
|
|
||||||
{ className: 'jasmine-spec-detail jasmine-failed' },
|
|
||||||
failureDescription(result, stateBuilder.currentParent),
|
|
||||||
createDom('div', { className: 'jasmine-messages' })
|
|
||||||
);
|
|
||||||
var messages = failure.childNodes[1];
|
|
||||||
|
|
||||||
for (var i = 0; i < result.failedExpectations.length; i++) {
|
|
||||||
var 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'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return failure;
|
|
||||||
}
|
|
||||||
|
|
||||||
function summaryList(resultsTree, domParent) {
|
|
||||||
var specListNode;
|
|
||||||
for (var i = 0; i < resultsTree.children.length; i++) {
|
|
||||||
var resultNode = resultsTree.children[i];
|
|
||||||
if (filterSpecs && !hasActiveSpec(resultNode)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (resultNode.type === 'suite') {
|
|
||||||
var 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);
|
|
||||||
}
|
|
||||||
var 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) {
|
|
||||||
var 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'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var failFastCheckbox = optionsMenuDom.querySelector('#jasmine-fail-fast');
|
|
||||||
failFastCheckbox.checked = config.failFast;
|
|
||||||
failFastCheckbox.onclick = function() {
|
|
||||||
navigateWithNewParam('failFast', !config.failFast);
|
|
||||||
};
|
|
||||||
|
|
||||||
var throwCheckbox = optionsMenuDom.querySelector(
|
|
||||||
'#jasmine-throw-failures'
|
|
||||||
);
|
|
||||||
throwCheckbox.checked = config.oneFailurePerSpec;
|
|
||||||
throwCheckbox.onclick = function() {
|
|
||||||
navigateWithNewParam('oneFailurePerSpec', !config.oneFailurePerSpec);
|
|
||||||
};
|
|
||||||
|
|
||||||
var randomCheckbox = optionsMenuDom.querySelector(
|
|
||||||
'#jasmine-random-order'
|
|
||||||
);
|
|
||||||
randomCheckbox.checked = config.random;
|
|
||||||
randomCheckbox.onclick = function() {
|
|
||||||
navigateWithNewParam('random', !config.random);
|
|
||||||
};
|
|
||||||
|
|
||||||
var hideDisabled = optionsMenuDom.querySelector('#jasmine-hide-disabled');
|
|
||||||
hideDisabled.checked = config.hideDisabled;
|
|
||||||
hideDisabled.onclick = function() {
|
|
||||||
navigateWithNewParam('hideDisabled', !config.hideDisabled);
|
|
||||||
};
|
|
||||||
|
|
||||||
var 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) {
|
|
||||||
var wrapper = createDom(
|
|
||||||
'div',
|
|
||||||
{ className: 'jasmine-description' },
|
|
||||||
createDom(
|
|
||||||
'a',
|
|
||||||
{ title: result.description, href: specHref(result) },
|
|
||||||
result.description
|
|
||||||
)
|
|
||||||
);
|
|
||||||
var 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) {
|
|
||||||
var 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 (var i = 0; i < result.deprecationWarnings.length; i++) {
|
|
||||||
var warning = result.deprecationWarnings[i].message;
|
|
||||||
if (!j$.util.arrayContains(warning)) {
|
|
||||||
deprecationWarnings.push({
|
|
||||||
message: warning,
|
|
||||||
runnableName: result.fullName,
|
|
||||||
runnableType: runnableType
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function find(selector) {
|
|
||||||
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearPrior() {
|
|
||||||
// return the reporter
|
|
||||||
var oldReporter = find('');
|
|
||||||
|
|
||||||
if (oldReporter) {
|
|
||||||
getContainer().removeChild(oldReporter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createDom(type, attrs, childrenVarArgs) {
|
|
||||||
var el = createElement(type);
|
|
||||||
|
|
||||||
for (var i = 2; i < arguments.length; i++) {
|
|
||||||
var child = arguments[i];
|
|
||||||
|
|
||||||
if (typeof child === 'string') {
|
|
||||||
el.appendChild(createTextNode(child));
|
|
||||||
} else {
|
|
||||||
if (child) {
|
|
||||||
el.appendChild(child);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var attr in attrs) {
|
|
||||||
if (attr == 'className') {
|
|
||||||
el[attr] = attrs[attr];
|
|
||||||
} else {
|
|
||||||
el.setAttribute(attr, attrs[attr]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return el;
|
|
||||||
}
|
|
||||||
|
|
||||||
function pluralize(singular, count) {
|
|
||||||
var 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) {
|
|
||||||
var 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 (var i = 0, j = resultNode.children.length; i < j; i++) {
|
|
||||||
if (hasActiveSpec(resultNode.children[i])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return HtmlReporter;
|
|
||||||
};
|
|
||||||
|
|
||||||
jasmineRequire.HtmlSpecFilter = function() {
|
|
||||||
function HtmlSpecFilter(options) {
|
|
||||||
var filterString =
|
|
||||||
options &&
|
|
||||||
options.filterString() &&
|
|
||||||
options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
||||||
var 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) {
|
|
||||||
var paramMap = queryStringToParamMap();
|
|
||||||
paramMap[key] = value;
|
|
||||||
return toQueryString(paramMap);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getParam = function(key) {
|
|
||||||
return queryStringToParamMap()[key];
|
|
||||||
};
|
|
||||||
|
|
||||||
return this;
|
|
||||||
|
|
||||||
function toQueryString(paramMap) {
|
|
||||||
var qStrPairs = [];
|
|
||||||
for (var prop in paramMap) {
|
|
||||||
qStrPairs.push(
|
|
||||||
encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return '?' + qStrPairs.join('&');
|
|
||||||
}
|
|
||||||
|
|
||||||
function queryStringToParamMap() {
|
|
||||||
var paramStr = options.getWindowLocation().search.substring(1),
|
|
||||||
params = [],
|
|
||||||
paramMap = {};
|
|
||||||
|
|
||||||
if (paramStr.length > 0) {
|
|
||||||
params = paramStr.split('&');
|
|
||||||
for (var i = 0; i < params.length; i++) {
|
|
||||||
var p = params[i].split('=');
|
|
||||||
var value = decodeURIComponent(p[1]);
|
|
||||||
if (value === 'true' || value === 'false') {
|
|
||||||
value = JSON.parse(value);
|
|
||||||
}
|
|
||||||
paramMap[decodeURIComponent(p[0])] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return paramMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QueryString;
|
|
||||||
};
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,489 +0,0 @@
|
|||||||
/*
|
|
||||||
json2.js
|
|
||||||
2014-02-04
|
|
||||||
|
|
||||||
Public Domain.
|
|
||||||
|
|
||||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
|
||||||
|
|
||||||
See http://www.JSON.org/js.html
|
|
||||||
|
|
||||||
|
|
||||||
This code should be minified before deployment.
|
|
||||||
See http://javascript.crockford.com/jsmin.html
|
|
||||||
|
|
||||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
|
||||||
NOT CONTROL.
|
|
||||||
|
|
||||||
|
|
||||||
This file creates a global JSON object containing two methods: stringify
|
|
||||||
and parse.
|
|
||||||
|
|
||||||
JSON.stringify(value, replacer, space)
|
|
||||||
value any JavaScript value, usually an object or array.
|
|
||||||
|
|
||||||
replacer an optional parameter that determines how object
|
|
||||||
values are stringified for objects. It can be a
|
|
||||||
function or an array of strings.
|
|
||||||
|
|
||||||
space an optional parameter that specifies the indentation
|
|
||||||
of nested structures. If it is omitted, the text will
|
|
||||||
be packed without extra whitespace. If it is a number,
|
|
||||||
it will specify the number of spaces to indent at each
|
|
||||||
level. If it is a string (such as '\t' or ' '),
|
|
||||||
it contains the characters used to indent at each level.
|
|
||||||
|
|
||||||
This method produces a JSON text from a JavaScript value.
|
|
||||||
|
|
||||||
When an object value is found, if the object contains a toJSON
|
|
||||||
method, its toJSON method will be called and the result will be
|
|
||||||
stringified. A toJSON method does not serialize: it returns the
|
|
||||||
value represented by the name/value pair that should be serialized,
|
|
||||||
or undefined if nothing should be serialized. The toJSON method
|
|
||||||
will be passed the key associated with the value, and this will be
|
|
||||||
bound to the value
|
|
||||||
|
|
||||||
For example, this would serialize Dates as ISO strings.
|
|
||||||
|
|
||||||
Date.prototype.toJSON = function (key) {
|
|
||||||
function f(n) {
|
|
||||||
// Format integers to have at least two digits.
|
|
||||||
return n < 10 ? '0' + n : n;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.getUTCFullYear() + '-' +
|
|
||||||
f(this.getUTCMonth() + 1) + '-' +
|
|
||||||
f(this.getUTCDate()) + 'T' +
|
|
||||||
f(this.getUTCHours()) + ':' +
|
|
||||||
f(this.getUTCMinutes()) + ':' +
|
|
||||||
f(this.getUTCSeconds()) + 'Z';
|
|
||||||
};
|
|
||||||
|
|
||||||
You can provide an optional replacer method. It will be passed the
|
|
||||||
key and value of each member, with this bound to the containing
|
|
||||||
object. The value that is returned from your method will be
|
|
||||||
serialized. If your method returns undefined, then the member will
|
|
||||||
be excluded from the serialization.
|
|
||||||
|
|
||||||
If the replacer parameter is an array of strings, then it will be
|
|
||||||
used to select the members to be serialized. It filters the results
|
|
||||||
such that only members with keys listed in the replacer array are
|
|
||||||
stringified.
|
|
||||||
|
|
||||||
Values that do not have JSON representations, such as undefined or
|
|
||||||
functions, will not be serialized. Such values in objects will be
|
|
||||||
dropped; in arrays they will be replaced with null. You can use
|
|
||||||
a replacer function to replace those with JSON values.
|
|
||||||
JSON.stringify(undefined) returns undefined.
|
|
||||||
|
|
||||||
The optional space parameter produces a stringification of the
|
|
||||||
value that is filled with line breaks and indentation to make it
|
|
||||||
easier to read.
|
|
||||||
|
|
||||||
If the space parameter is a non-empty string, then that string will
|
|
||||||
be used for indentation. If the space parameter is a number, then
|
|
||||||
the indentation will be that many spaces.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
|
||||||
// text is '["e",{"pluribus":"unum"}]'
|
|
||||||
|
|
||||||
|
|
||||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
|
||||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
|
||||||
|
|
||||||
text = JSON.stringify([new Date()], function (key, value) {
|
|
||||||
return this[key] instanceof Date ?
|
|
||||||
'Date(' + this[key] + ')' : value;
|
|
||||||
});
|
|
||||||
// text is '["Date(---current time---)"]'
|
|
||||||
|
|
||||||
|
|
||||||
JSON.parse(text, reviver)
|
|
||||||
This method parses a JSON text to produce an object or array.
|
|
||||||
It can throw a SyntaxError exception.
|
|
||||||
|
|
||||||
The optional reviver parameter is a function that can filter and
|
|
||||||
transform the results. It receives each of the keys and values,
|
|
||||||
and its return value is used instead of the original value.
|
|
||||||
If it returns what it received, then the structure is not modified.
|
|
||||||
If it returns undefined then the member is deleted.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
// Parse the text. Values that look like ISO date strings will
|
|
||||||
// be converted to Date objects.
|
|
||||||
|
|
||||||
myData = JSON.parse(text, function (key, value) {
|
|
||||||
var a;
|
|
||||||
if (typeof value === 'string') {
|
|
||||||
a =
|
|
||||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
|
||||||
if (a) {
|
|
||||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
|
||||||
+a[5], +a[6]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
});
|
|
||||||
|
|
||||||
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
|
||||||
var d;
|
|
||||||
if (typeof value === 'string' &&
|
|
||||||
value.slice(0, 5) === 'Date(' &&
|
|
||||||
value.slice(-1) === ')') {
|
|
||||||
d = new Date(value.slice(5, -1));
|
|
||||||
if (d) {
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
This is a reference implementation. You are free to copy, modify, or
|
|
||||||
redistribute.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*jslint evil: true, regexp: true */
|
|
||||||
|
|
||||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
|
||||||
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
|
||||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
|
||||||
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
|
||||||
test, toJSON, toString, valueOf
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Create a JSON object only if one does not already exist. We create the
|
|
||||||
// methods in a closure to avoid creating global variables.
|
|
||||||
|
|
||||||
if (typeof JSON !== 'object') {
|
|
||||||
JSON = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
function f(n) {
|
|
||||||
// Format integers to have at least two digits.
|
|
||||||
return n < 10 ? '0' + n : n;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof Date.prototype.toJSON !== 'function') {
|
|
||||||
|
|
||||||
Date.prototype.toJSON = function () {
|
|
||||||
|
|
||||||
return isFinite(this.valueOf())
|
|
||||||
? this.getUTCFullYear() + '-' +
|
|
||||||
f(this.getUTCMonth() + 1) + '-' +
|
|
||||||
f(this.getUTCDate()) + 'T' +
|
|
||||||
f(this.getUTCHours()) + ':' +
|
|
||||||
f(this.getUTCMinutes()) + ':' +
|
|
||||||
f(this.getUTCSeconds()) + 'Z'
|
|
||||||
: null;
|
|
||||||
};
|
|
||||||
|
|
||||||
String.prototype.toJSON =
|
|
||||||
Number.prototype.toJSON =
|
|
||||||
Boolean.prototype.toJSON = function () {
|
|
||||||
return this.valueOf();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
var cx,
|
|
||||||
escapable,
|
|
||||||
gap,
|
|
||||||
indent,
|
|
||||||
meta,
|
|
||||||
rep;
|
|
||||||
|
|
||||||
|
|
||||||
function quote(string) {
|
|
||||||
|
|
||||||
// If the string contains no control characters, no quote characters, and no
|
|
||||||
// backslash characters, then we can safely slap some quotes around it.
|
|
||||||
// Otherwise we must also replace the offending characters with safe escape
|
|
||||||
// sequences.
|
|
||||||
|
|
||||||
escapable.lastIndex = 0;
|
|
||||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
|
||||||
var c = meta[a];
|
|
||||||
return typeof c === 'string'
|
|
||||||
? c
|
|
||||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
|
||||||
}) + '"' : '"' + string + '"';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function str(key, holder) {
|
|
||||||
|
|
||||||
// Produce a string from holder[key].
|
|
||||||
|
|
||||||
var i, // The loop counter.
|
|
||||||
k, // The member key.
|
|
||||||
v, // The member value.
|
|
||||||
length,
|
|
||||||
mind = gap,
|
|
||||||
partial,
|
|
||||||
value = holder[key];
|
|
||||||
|
|
||||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
|
||||||
|
|
||||||
if (value && typeof value === 'object' &&
|
|
||||||
typeof value.toJSON === 'function') {
|
|
||||||
value = value.toJSON(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we were called with a replacer function, then call the replacer to
|
|
||||||
// obtain a replacement value.
|
|
||||||
|
|
||||||
if (typeof rep === 'function') {
|
|
||||||
value = rep.call(holder, key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
// What happens next depends on the value's type.
|
|
||||||
|
|
||||||
switch (typeof value) {
|
|
||||||
case 'string':
|
|
||||||
return quote(value);
|
|
||||||
|
|
||||||
case 'number':
|
|
||||||
|
|
||||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
|
||||||
|
|
||||||
return isFinite(value) ? String(value) : 'null';
|
|
||||||
|
|
||||||
case 'boolean':
|
|
||||||
case 'null':
|
|
||||||
|
|
||||||
// If the value is a boolean or null, convert it to a string. Note:
|
|
||||||
// typeof null does not produce 'null'. The case is included here in
|
|
||||||
// the remote chance that this gets fixed someday.
|
|
||||||
|
|
||||||
return String(value);
|
|
||||||
|
|
||||||
// If the type is 'object', we might be dealing with an object or an array or
|
|
||||||
// null.
|
|
||||||
|
|
||||||
case 'object':
|
|
||||||
|
|
||||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
|
||||||
// so watch out for that case.
|
|
||||||
|
|
||||||
if (!value) {
|
|
||||||
return 'null';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make an array to hold the partial results of stringifying this object value.
|
|
||||||
|
|
||||||
gap += indent;
|
|
||||||
partial = [];
|
|
||||||
|
|
||||||
// Is the value an array?
|
|
||||||
|
|
||||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
|
||||||
|
|
||||||
// The value is an array. Stringify every element. Use null as a placeholder
|
|
||||||
// for non-JSON values.
|
|
||||||
|
|
||||||
length = value.length;
|
|
||||||
for (i = 0; i < length; i += 1) {
|
|
||||||
partial[i] = str(i, value) || 'null';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Join all of the elements together, separated with commas, and wrap them in
|
|
||||||
// brackets.
|
|
||||||
|
|
||||||
v = partial.length === 0
|
|
||||||
? '[]'
|
|
||||||
: gap
|
|
||||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
|
||||||
: '[' + partial.join(',') + ']';
|
|
||||||
gap = mind;
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the replacer is an array, use it to select the members to be stringified.
|
|
||||||
|
|
||||||
if (rep && typeof rep === 'object') {
|
|
||||||
length = rep.length;
|
|
||||||
for (i = 0; i < length; i += 1) {
|
|
||||||
if (typeof rep[i] === 'string') {
|
|
||||||
k = rep[i];
|
|
||||||
v = str(k, value);
|
|
||||||
if (v) {
|
|
||||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// Otherwise, iterate through all of the keys in the object.
|
|
||||||
|
|
||||||
for (k in value) {
|
|
||||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
|
||||||
v = str(k, value);
|
|
||||||
if (v) {
|
|
||||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Join all of the member texts together, separated with commas,
|
|
||||||
// and wrap them in braces.
|
|
||||||
|
|
||||||
v = partial.length === 0
|
|
||||||
? '{}'
|
|
||||||
: gap
|
|
||||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
|
||||||
: '{' + partial.join(',') + '}';
|
|
||||||
gap = mind;
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the JSON object does not yet have a stringify method, give it one.
|
|
||||||
|
|
||||||
if (typeof JSON.stringify !== 'function') {
|
|
||||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
|
||||||
meta = { // table of character substitutions
|
|
||||||
'\b': '\\b',
|
|
||||||
'\t': '\\t',
|
|
||||||
'\n': '\\n',
|
|
||||||
'\f': '\\f',
|
|
||||||
'\r': '\\r',
|
|
||||||
'"' : '\\"',
|
|
||||||
'\\': '\\\\'
|
|
||||||
};
|
|
||||||
JSON.stringify = function (value, replacer, space) {
|
|
||||||
|
|
||||||
// The stringify method takes a value and an optional replacer, and an optional
|
|
||||||
// space parameter, and returns a JSON text. The replacer can be a function
|
|
||||||
// that can replace values, or an array of strings that will select the keys.
|
|
||||||
// A default replacer method can be provided. Use of the space parameter can
|
|
||||||
// produce text that is more easily readable.
|
|
||||||
|
|
||||||
var i;
|
|
||||||
gap = '';
|
|
||||||
indent = '';
|
|
||||||
|
|
||||||
// If the space parameter is a number, make an indent string containing that
|
|
||||||
// many spaces.
|
|
||||||
|
|
||||||
if (typeof space === 'number') {
|
|
||||||
for (i = 0; i < space; i += 1) {
|
|
||||||
indent += ' ';
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the space parameter is a string, it will be used as the indent string.
|
|
||||||
|
|
||||||
} else if (typeof space === 'string') {
|
|
||||||
indent = space;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there is a replacer, it must be a function or an array.
|
|
||||||
// Otherwise, throw an error.
|
|
||||||
|
|
||||||
rep = replacer;
|
|
||||||
if (replacer && typeof replacer !== 'function' &&
|
|
||||||
(typeof replacer !== 'object' ||
|
|
||||||
typeof replacer.length !== 'number')) {
|
|
||||||
throw new Error('JSON.stringify');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make a fake root object containing our value under the key of ''.
|
|
||||||
// Return the result of stringifying the value.
|
|
||||||
|
|
||||||
return str('', {'': value});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// If the JSON object does not yet have a parse method, give it one.
|
|
||||||
|
|
||||||
if (typeof JSON.parse !== 'function') {
|
|
||||||
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
|
||||||
JSON.parse = function (text, reviver) {
|
|
||||||
|
|
||||||
// The parse method takes a text and an optional reviver function, and returns
|
|
||||||
// a JavaScript value if the text is a valid JSON text.
|
|
||||||
|
|
||||||
var j;
|
|
||||||
|
|
||||||
function walk(holder, key) {
|
|
||||||
|
|
||||||
// The walk method is used to recursively walk the resulting structure so
|
|
||||||
// that modifications can be made.
|
|
||||||
|
|
||||||
var k, v, value = holder[key];
|
|
||||||
if (value && typeof value === 'object') {
|
|
||||||
for (k in value) {
|
|
||||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
|
||||||
v = walk(value, k);
|
|
||||||
if (v !== undefined) {
|
|
||||||
value[k] = v;
|
|
||||||
} else {
|
|
||||||
delete value[k];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return reviver.call(holder, key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Parsing happens in four stages. In the first stage, we replace certain
|
|
||||||
// Unicode characters with escape sequences. JavaScript handles many characters
|
|
||||||
// incorrectly, either silently deleting them, or treating them as line endings.
|
|
||||||
|
|
||||||
text = String(text);
|
|
||||||
cx.lastIndex = 0;
|
|
||||||
if (cx.test(text)) {
|
|
||||||
text = text.replace(cx, function (a) {
|
|
||||||
return '\\u' +
|
|
||||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// In the second stage, we run the text against regular expressions that look
|
|
||||||
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
|
||||||
// because they can cause invocation, and '=' because it can cause mutation.
|
|
||||||
// But just to be safe, we want to reject all unexpected forms.
|
|
||||||
|
|
||||||
// We split the second stage into 4 regexp operations in order to work around
|
|
||||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
|
||||||
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
|
||||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
|
||||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
|
||||||
// we look to see that the remaining characters are only whitespace or ']' or
|
|
||||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
|
||||||
|
|
||||||
if (/^[\],:{}\s]*$/
|
|
||||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
|
||||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
|
||||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
|
||||||
|
|
||||||
// In the third stage we use the eval function to compile the text into a
|
|
||||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
|
||||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
|
||||||
// in parens to eliminate the ambiguity.
|
|
||||||
|
|
||||||
j = eval('(' + text + ')');
|
|
||||||
|
|
||||||
// In the optional fourth stage, we recursively walk the new structure, passing
|
|
||||||
// each name/value pair to a reviver function for possible transformation.
|
|
||||||
|
|
||||||
return typeof reviver === 'function'
|
|
||||||
? walk({'': j}, '')
|
|
||||||
: j;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
|
||||||
|
|
||||||
throw new SyntaxError('JSON.parse');
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}());
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2008-2021 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) {
|
|
||||||
var jasmine = jasmineRequire.core(jasmineRequire);
|
|
||||||
|
|
||||||
var env = jasmine.getEnv({suppressLoadErrors: true});
|
|
||||||
|
|
||||||
var jasmineInterface = jasmineRequire.interface(jasmine, env);
|
|
||||||
|
|
||||||
extend(global, jasmineInterface);
|
|
||||||
|
|
||||||
function extend(destination, source) {
|
|
||||||
for (var property in source) destination[property] = source[property];
|
|
||||||
return destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
return jasmine;
|
|
||||||
};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#
|
|
||||||
# DO NOT Edit this file. Canonical version of Jasmine lives in the repo's package.json. This file is generated
|
|
||||||
# by a grunt task when the standalone release is built.
|
|
||||||
#
|
|
||||||
module Jasmine
|
|
||||||
module Core
|
|
||||||
VERSION = "3.8.0"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
require 'jasmine/base'
|
||||||
|
require 'jasmine/config'
|
||||||
|
require 'jasmine/server'
|
||||||
|
require 'jasmine/selenium_driver'
|
||||||
|
|
||||||
|
require 'jasmine/spec_builder'
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
require 'socket'
|
||||||
|
require 'erb'
|
||||||
|
require 'json'
|
||||||
|
|
||||||
|
module Jasmine
|
||||||
|
def self.root
|
||||||
|
File.expand_path(File.join(File.dirname(__FILE__), '../../jasmine'))
|
||||||
|
end
|
||||||
|
|
||||||
|
# this seemingly-over-complex method is necessary to get an open port on at least some of our Macs
|
||||||
|
def self.open_socket_on_unused_port
|
||||||
|
infos = Socket::getaddrinfo("localhost", nil, Socket::AF_UNSPEC, Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
|
||||||
|
families = Hash[*infos.collect { |af, *_| af }.uniq.zip([]).flatten]
|
||||||
|
|
||||||
|
return TCPServer.open('0.0.0.0', 0) if families.has_key?('AF_INET')
|
||||||
|
return TCPServer.open('::', 0) if families.has_key?('AF_INET6')
|
||||||
|
return TCPServer.open(0)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.find_unused_port
|
||||||
|
socket = open_socket_on_unused_port
|
||||||
|
port = socket.addr[1]
|
||||||
|
socket.close
|
||||||
|
port
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.server_is_listening_on(hostname, port)
|
||||||
|
require 'socket'
|
||||||
|
begin
|
||||||
|
socket = TCPSocket.open(hostname, port)
|
||||||
|
rescue Errno::ECONNREFUSED
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
socket.close
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.wait_for_listener(port, name = "required process", seconds_to_wait = 10)
|
||||||
|
time_out_at = Time.now + seconds_to_wait
|
||||||
|
until server_is_listening_on "localhost", port
|
||||||
|
sleep 0.1
|
||||||
|
puts "Waiting for #{name} on #{port}..."
|
||||||
|
raise "#{name} didn't show up on port #{port} after #{seconds_to_wait} seconds." if Time.now > time_out_at
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.kill_process_group(process_group_id, signal="TERM")
|
||||||
|
Process.kill signal, -process_group_id # negative pid means kill process group. (see man 2 kill)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.cachebust(files, root_dir="", replace=nil, replace_with=nil)
|
||||||
|
require 'digest/md5'
|
||||||
|
files.collect do |file_name|
|
||||||
|
real_file_name = replace && replace_with ? file_name.sub(replace, replace_with) : file_name
|
||||||
|
begin
|
||||||
|
digest = Digest::MD5.hexdigest(File.read("#{root_dir}#{real_file_name}"))
|
||||||
|
rescue
|
||||||
|
digest = "MISSING-FILE"
|
||||||
|
end
|
||||||
|
"#{file_name}?cachebust=#{digest}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
module Jasmine
|
||||||
|
class Config
|
||||||
|
require 'yaml'
|
||||||
|
|
||||||
|
def initialize(options = {})
|
||||||
|
require 'selenium_rc'
|
||||||
|
@selenium_jar_path = SeleniumRC::Server.allocate.jar_path
|
||||||
|
|
||||||
|
@browser = ENV["JASMINE_BROWSER"] || 'firefox'
|
||||||
|
@selenium_pid = nil
|
||||||
|
@jasmine_server_pid = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def start_server(port = 8888)
|
||||||
|
Jasmine::Server.new(port, self).start
|
||||||
|
end
|
||||||
|
|
||||||
|
def start
|
||||||
|
start_servers
|
||||||
|
@client = Jasmine::SeleniumDriver.new("localhost", @selenium_server_port, "*#{@browser}", "http://localhost:#{@jasmine_server_port}/")
|
||||||
|
@client.connect
|
||||||
|
end
|
||||||
|
|
||||||
|
def stop
|
||||||
|
@client.disconnect
|
||||||
|
stop_servers
|
||||||
|
end
|
||||||
|
|
||||||
|
def start_jasmine_server
|
||||||
|
@jasmine_server_port = Jasmine::find_unused_port
|
||||||
|
server = Jasmine::Server.new(@jasmine_server_port, self)
|
||||||
|
@jasmine_server_pid = fork do
|
||||||
|
Process.setpgrp
|
||||||
|
server.start
|
||||||
|
exit! 0
|
||||||
|
end
|
||||||
|
puts "jasmine server started. pid is #{@jasmine_server_pid}"
|
||||||
|
Jasmine::wait_for_listener(@jasmine_server_port, "jasmine server")
|
||||||
|
end
|
||||||
|
|
||||||
|
def external_selenium_server_port
|
||||||
|
ENV['SELENIUM_SERVER_PORT'] && ENV['SELENIUM_SERVER_PORT'].to_i > 0 ? ENV['SELENIUM_SERVER_PORT'].to_i : nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def start_selenium_server
|
||||||
|
@selenium_server_port = external_selenium_server_port
|
||||||
|
if @selenium_server_port.nil?
|
||||||
|
@selenium_server_port = Jasmine::find_unused_port
|
||||||
|
@selenium_pid = fork do
|
||||||
|
Process.setpgrp
|
||||||
|
exec "java -jar #{@selenium_jar_path} -port #{@selenium_server_port} > /dev/null 2>&1"
|
||||||
|
end
|
||||||
|
puts "selenium started. pid is #{@selenium_pid}"
|
||||||
|
end
|
||||||
|
Jasmine::wait_for_listener(@selenium_server_port, "selenium server")
|
||||||
|
end
|
||||||
|
|
||||||
|
def start_servers
|
||||||
|
start_jasmine_server
|
||||||
|
start_selenium_server
|
||||||
|
end
|
||||||
|
|
||||||
|
def stop_servers
|
||||||
|
puts "shutting down the servers..."
|
||||||
|
Jasmine::kill_process_group(@selenium_pid) if @selenium_pid
|
||||||
|
Jasmine::kill_process_group(@jasmine_server_pid) if @jasmine_server_pid
|
||||||
|
end
|
||||||
|
|
||||||
|
def run
|
||||||
|
begin
|
||||||
|
start
|
||||||
|
puts "servers are listening on their ports -- running the test script..."
|
||||||
|
tests_passed = @client.run
|
||||||
|
ensure
|
||||||
|
stop
|
||||||
|
end
|
||||||
|
return tests_passed
|
||||||
|
end
|
||||||
|
|
||||||
|
def eval_js(script)
|
||||||
|
@client.eval_js(script)
|
||||||
|
end
|
||||||
|
|
||||||
|
def match_files(dir, patterns)
|
||||||
|
dir = File.expand_path(dir)
|
||||||
|
patterns.collect do |pattern|
|
||||||
|
Dir.glob(File.join(dir, pattern)).collect {|f| f.sub("#{dir}/", "")}.sort
|
||||||
|
end.flatten
|
||||||
|
end
|
||||||
|
|
||||||
|
def simple_config
|
||||||
|
config = File.exist?(simple_config_file) ? File.open(simple_config_file) { |yf| YAML::load( yf ) } : false
|
||||||
|
config || {}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def spec_path
|
||||||
|
"/__spec__"
|
||||||
|
end
|
||||||
|
|
||||||
|
def root_path
|
||||||
|
"/__root__"
|
||||||
|
end
|
||||||
|
|
||||||
|
def mappings
|
||||||
|
{
|
||||||
|
spec_path => spec_dir,
|
||||||
|
root_path => project_root
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
def js_files
|
||||||
|
src_files.collect {|f| "/" + f } + spec_files.collect {|f| File.join(spec_path, f) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def css_files
|
||||||
|
stylesheets.collect {|f| "/" + f }
|
||||||
|
end
|
||||||
|
|
||||||
|
def spec_files_full_paths
|
||||||
|
spec_files.collect {|spec_file| File.join(spec_dir, spec_file) }
|
||||||
|
end
|
||||||
|
|
||||||
|
def project_root
|
||||||
|
Dir.pwd
|
||||||
|
end
|
||||||
|
|
||||||
|
def simple_config_file
|
||||||
|
File.join(project_root, 'spec/javascripts/support/jasmine.yml')
|
||||||
|
end
|
||||||
|
|
||||||
|
def src_dir
|
||||||
|
if simple_config['src_dir']
|
||||||
|
File.join(project_root, simple_config['src_dir'])
|
||||||
|
else
|
||||||
|
project_root
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def spec_dir
|
||||||
|
if simple_config['spec_dir']
|
||||||
|
File.join(project_root, simple_config['spec_dir'])
|
||||||
|
else
|
||||||
|
File.join(project_root, 'spec/javascripts')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def src_files
|
||||||
|
files = []
|
||||||
|
if simple_config['src_files']
|
||||||
|
files = match_files(src_dir, simple_config['src_files'])
|
||||||
|
end
|
||||||
|
files
|
||||||
|
end
|
||||||
|
|
||||||
|
def spec_files
|
||||||
|
files = match_files(spec_dir, "**/*.js")
|
||||||
|
if simple_config['spec_files']
|
||||||
|
files = match_files(spec_dir, simple_config['spec_files'])
|
||||||
|
end
|
||||||
|
files
|
||||||
|
end
|
||||||
|
|
||||||
|
def stylesheets
|
||||||
|
files = []
|
||||||
|
if simple_config['stylesheets']
|
||||||
|
files = match_files(src_dir, simple_config['stylesheets'])
|
||||||
|
end
|
||||||
|
files
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||||
|
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
|
||||||
|
<title>Jasmine suite</title>
|
||||||
|
<% css_files.each do |css_file| %>
|
||||||
|
<link rel="stylesheet" href="<%= css_file %>" type="text/css" media="screen"/>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% jasmine_files.each do |jasmine_file| %>
|
||||||
|
<script src="<%= jasmine_file %>" type="text/javascript"></script>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var jsApiReporter;
|
||||||
|
(function() {
|
||||||
|
var jasmineEnv = jasmine.getEnv();
|
||||||
|
|
||||||
|
jsApiReporter = new jasmine.JsApiReporter();
|
||||||
|
var trivialReporter = new jasmine.TrivialReporter();
|
||||||
|
|
||||||
|
jasmineEnv.addReporter(jsApiReporter);
|
||||||
|
jasmineEnv.addReporter(trivialReporter);
|
||||||
|
|
||||||
|
jasmineEnv.specFilter = function(spec) {
|
||||||
|
return trivialReporter.specFilter(spec);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
jasmineEnv.execute();
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<% js_files.each do |js_file| %>
|
||||||
|
<script src="<%= js_file %>" type="text/javascript"></script>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="jasmine_content"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
module Jasmine
|
||||||
|
class SeleniumDriver
|
||||||
|
def initialize(selenium_host, selenium_port, selenium_browser_start_command, http_address)
|
||||||
|
require 'selenium/client'
|
||||||
|
@driver = Selenium::Client::Driver.new(
|
||||||
|
selenium_host,
|
||||||
|
selenium_port,
|
||||||
|
selenium_browser_start_command,
|
||||||
|
http_address
|
||||||
|
)
|
||||||
|
@http_address = http_address
|
||||||
|
end
|
||||||
|
|
||||||
|
def tests_have_finished?
|
||||||
|
@driver.get_eval("window.jasmine.getEnv().currentRunner.finished") == "true"
|
||||||
|
end
|
||||||
|
|
||||||
|
def connect
|
||||||
|
@driver.start
|
||||||
|
@driver.open("/")
|
||||||
|
end
|
||||||
|
|
||||||
|
def disconnect
|
||||||
|
@driver.stop
|
||||||
|
end
|
||||||
|
|
||||||
|
def run
|
||||||
|
until tests_have_finished? do
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
|
|
||||||
|
puts @driver.get_eval("window.results()")
|
||||||
|
failed_count = @driver.get_eval("window.jasmine.getEnv().currentRunner.results().failedCount").to_i
|
||||||
|
failed_count == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
def eval_js(script)
|
||||||
|
escaped_script = "'" + script.gsub(/(['\\])/) { '\\' + $1 } + "'"
|
||||||
|
|
||||||
|
result = @driver.get_eval("try { eval(#{escaped_script}, window); } catch(err) { window.eval(#{escaped_script}); }")
|
||||||
|
JSON.parse("{\"result\":#{result}}")["result"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
module Jasmine
|
||||||
|
class RunAdapter
|
||||||
|
def initialize(config)
|
||||||
|
@config = config
|
||||||
|
@jasmine_files = [
|
||||||
|
"/__JASMINE_ROOT__/lib/" + File.basename(Dir.glob("#{Jasmine.root}/lib/jasmine*.js").first),
|
||||||
|
"/__JASMINE_ROOT__/lib/TrivialReporter.js",
|
||||||
|
"/__JASMINE_ROOT__/lib/json2.js",
|
||||||
|
"/__JASMINE_ROOT__/lib/consolex.js",
|
||||||
|
]
|
||||||
|
@jasmine_stylesheets = ["/__JASMINE_ROOT__/lib/jasmine.css"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def call(env)
|
||||||
|
return not_found if env["PATH_INFO"] != "/"
|
||||||
|
return [200,{ 'Content-Type' => 'text/html' }, ''] if (env['REQUEST_METHOD'] == 'HEAD')
|
||||||
|
run if env['REQUEST_METHOD'] == 'GET'
|
||||||
|
end
|
||||||
|
|
||||||
|
def not_found
|
||||||
|
body = "File not found: #{@path_info}\n"
|
||||||
|
[404, {"Content-Type" => "text/plain",
|
||||||
|
"Content-Length" => body.size.to_s,
|
||||||
|
"X-Cascade" => "pass"},
|
||||||
|
[body]]
|
||||||
|
end
|
||||||
|
|
||||||
|
#noinspection RubyUnusedLocalVariable
|
||||||
|
def run
|
||||||
|
jasmine_files = @jasmine_files
|
||||||
|
css_files = @jasmine_stylesheets + (@config.css_files || [])
|
||||||
|
js_files = @config.js_files
|
||||||
|
|
||||||
|
body = ERB.new(File.read(File.join(File.dirname(__FILE__), "run.html.erb"))).result(binding)
|
||||||
|
[
|
||||||
|
200,
|
||||||
|
{ 'Content-Type' => 'text/html' },
|
||||||
|
body
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Redirect
|
||||||
|
def initialize(url)
|
||||||
|
@url = url
|
||||||
|
end
|
||||||
|
|
||||||
|
def call(env)
|
||||||
|
[
|
||||||
|
302,
|
||||||
|
{ 'Location' => @url },
|
||||||
|
[]
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class JsAlert
|
||||||
|
def call(env)
|
||||||
|
[
|
||||||
|
200,
|
||||||
|
{ 'Content-Type' => 'application/javascript' },
|
||||||
|
"document.write('<p>Couldn\\'t load #{env["PATH_INFO"]}!</p>');"
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class FocusedSuite
|
||||||
|
def initialize(config)
|
||||||
|
@config = config
|
||||||
|
end
|
||||||
|
|
||||||
|
def call(env)
|
||||||
|
spec_files = @config.spec_files_or_proc
|
||||||
|
matching_specs = spec_files.select {|spec_file| spec_file =~ /#{Regexp.escape(env["PATH_INFO"])}/ }.compact
|
||||||
|
if !matching_specs.empty?
|
||||||
|
run_adapter = Jasmine::RunAdapter.new(matching_specs, @options)
|
||||||
|
run_adapter.run
|
||||||
|
else
|
||||||
|
[
|
||||||
|
200,
|
||||||
|
{ 'Content-Type' => 'application/javascript' },
|
||||||
|
"document.write('<p>Couldn\\'t find any specs matching #{env["PATH_INFO"]}!</p>');"
|
||||||
|
]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Server
|
||||||
|
attr_reader :thin
|
||||||
|
|
||||||
|
def initialize(port, config)
|
||||||
|
@port = port
|
||||||
|
@config = config
|
||||||
|
|
||||||
|
require 'thin'
|
||||||
|
thin_config = {
|
||||||
|
'/__suite__' => Jasmine::FocusedSuite.new(@config),
|
||||||
|
'/run.html' => Jasmine::Redirect.new('/'),
|
||||||
|
'/' => Jasmine::RunAdapter.new(@config)
|
||||||
|
}
|
||||||
|
|
||||||
|
@config.mappings.each do |from, to|
|
||||||
|
thin_config[from] = Rack::File.new(to)
|
||||||
|
end
|
||||||
|
|
||||||
|
thin_config["/__JASMINE_ROOT__"] = Rack::File.new(Jasmine.root)
|
||||||
|
|
||||||
|
app = Rack::Cascade.new([
|
||||||
|
Rack::URLMap.new({'/' => Rack::File.new(@config.src_dir)}),
|
||||||
|
Rack::URLMap.new(thin_config)
|
||||||
|
# JsAlert.new
|
||||||
|
])
|
||||||
|
# Thin::Logging.trace = true
|
||||||
|
@thin = Thin::Server.new('0.0.0.0', @port, app)
|
||||||
|
end
|
||||||
|
|
||||||
|
def start
|
||||||
|
begin
|
||||||
|
thin.start
|
||||||
|
rescue RuntimeError => e
|
||||||
|
raise e unless e.message == 'no acceptor'
|
||||||
|
raise RuntimeError.new("A server is already running on port #{@port}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def stop
|
||||||
|
thin.stop
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
require 'enumerator'
|
||||||
|
|
||||||
|
module Jasmine
|
||||||
|
class SpecBuilder
|
||||||
|
attr_accessor :suites
|
||||||
|
|
||||||
|
def initialize(config)
|
||||||
|
@config = config
|
||||||
|
@spec_files = config.spec_files
|
||||||
|
@runner = config
|
||||||
|
@spec_ids = []
|
||||||
|
end
|
||||||
|
|
||||||
|
def start
|
||||||
|
guess_example_locations
|
||||||
|
|
||||||
|
@runner.start
|
||||||
|
load_suite_info
|
||||||
|
wait_for_suites_to_finish_running
|
||||||
|
end
|
||||||
|
|
||||||
|
def stop
|
||||||
|
@runner.stop
|
||||||
|
end
|
||||||
|
|
||||||
|
def script_path
|
||||||
|
File.expand_path(__FILE__)
|
||||||
|
end
|
||||||
|
|
||||||
|
def guess_example_locations
|
||||||
|
@example_locations = {}
|
||||||
|
|
||||||
|
example_name_parts = []
|
||||||
|
previous_indent_level = 0
|
||||||
|
@config.spec_files_full_paths.each do |filename|
|
||||||
|
line_number = 1
|
||||||
|
File.open(filename, "r") do |file|
|
||||||
|
file.readlines.each do |line|
|
||||||
|
match = /^(\s*)(describe|it)\s*\(\s*["'](.*)["']\s*,\s*function/.match(line)
|
||||||
|
if (match)
|
||||||
|
indent_level = match[1].length / 2
|
||||||
|
example_name = match[3]
|
||||||
|
example_name_parts[indent_level] = example_name
|
||||||
|
|
||||||
|
full_example_name = example_name_parts.slice(0, indent_level + 1).join(" ")
|
||||||
|
@example_locations[full_example_name] = "#{filename}:#{line_number}: in `it'"
|
||||||
|
end
|
||||||
|
line_number += 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def load_suite_info
|
||||||
|
started = Time.now
|
||||||
|
while !eval_js('jsApiReporter && jsApiReporter.started') do
|
||||||
|
raise "couldn't connect to Jasmine after 60 seconds" if (started + 60 < Time.now)
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
|
|
||||||
|
@suites = eval_js("var result = jsApiReporter.suites(); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }")
|
||||||
|
end
|
||||||
|
|
||||||
|
def results_for(spec_id)
|
||||||
|
@spec_results ||= load_results
|
||||||
|
@spec_results[spec_id.to_s]
|
||||||
|
end
|
||||||
|
|
||||||
|
def load_results
|
||||||
|
@spec_results = {}
|
||||||
|
@spec_ids.each_slice(50) do |slice|
|
||||||
|
@spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }"))
|
||||||
|
end
|
||||||
|
@spec_results
|
||||||
|
end
|
||||||
|
|
||||||
|
def wait_for_suites_to_finish_running
|
||||||
|
puts "Waiting for suite to finish in browser ..."
|
||||||
|
while !eval_js('jsApiReporter.finished') do
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def declare_suites
|
||||||
|
me = self
|
||||||
|
suites.each do |suite|
|
||||||
|
declare_suite(self, suite)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def declare_suite(parent, suite)
|
||||||
|
me = self
|
||||||
|
parent.describe suite["name"] do
|
||||||
|
suite["children"].each do |suite_or_spec|
|
||||||
|
type = suite_or_spec["type"]
|
||||||
|
if type == "suite"
|
||||||
|
me.declare_suite(self, suite_or_spec)
|
||||||
|
elsif type == "spec"
|
||||||
|
me.declare_spec(self, suite_or_spec)
|
||||||
|
else
|
||||||
|
raise "unknown type #{type} for #{suite_or_spec.inspect}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def declare_spec(parent, spec)
|
||||||
|
me = self
|
||||||
|
example_name = spec["name"]
|
||||||
|
@spec_ids << spec["id"]
|
||||||
|
backtrace = @example_locations[parent.description + " " + example_name]
|
||||||
|
parent.it example_name, {}, backtrace do
|
||||||
|
me.report_spec(spec["id"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def report_spec(spec_id)
|
||||||
|
spec_results = results_for(spec_id)
|
||||||
|
out = ""
|
||||||
|
messages = spec_results['messages'].each do |message|
|
||||||
|
case
|
||||||
|
when message["type"] == "MessageResult"
|
||||||
|
puts message["text"]
|
||||||
|
puts "\n"
|
||||||
|
else
|
||||||
|
unless message["message"] =~ /^Passed.$/
|
||||||
|
STDERR << message["message"]
|
||||||
|
STDERR << "\n"
|
||||||
|
|
||||||
|
out << message["message"]
|
||||||
|
out << "\n"
|
||||||
|
end
|
||||||
|
|
||||||
|
if !message["passed"] && message["trace"]["stack"]
|
||||||
|
stack_trace = message["trace"]["stack"].gsub(/<br \/>/, "\n").gsub(/<\/?b>/, " ")
|
||||||
|
STDERR << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/")
|
||||||
|
STDERR << "\n"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
fail out unless spec_results['result'] == 'passed'
|
||||||
|
puts out unless out.empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def eval_js(js)
|
||||||
|
@runner.eval_js(js)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
-105
@@ -1,105 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "jasmine-core",
|
|
||||||
"license": "MIT",
|
|
||||||
"version": "3.8.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": {
|
|
||||||
"ejs": "^2.5.5",
|
|
||||||
"eslint": "^6.8.0",
|
|
||||||
"eslint-plugin-compat": "^3.8.0",
|
|
||||||
"fast-check": "^1.21.0",
|
|
||||||
"fast-glob": "^2.2.6",
|
|
||||||
"grunt": "^1.0.4",
|
|
||||||
"grunt-cli": "^1.3.2",
|
|
||||||
"grunt-contrib-compress": "^1.3.0",
|
|
||||||
"grunt-contrib-concat": "^1.0.1",
|
|
||||||
"grunt-css-url-embed": "^1.11.1",
|
|
||||||
"grunt-sass": "^3.0.2",
|
|
||||||
"jasmine": "^3.4.0",
|
|
||||||
"jasmine-browser-runner": "github:jasmine/jasmine-browser#main",
|
|
||||||
"jsdom": "^15.0.0",
|
|
||||||
"load-grunt-tasks": "^4.0.0",
|
|
||||||
"prettier": "1.17.1",
|
|
||||||
"sass": "^1.32.12",
|
|
||||||
"shelljs": "^0.8.3",
|
|
||||||
"temp": "^0.9.0"
|
|
||||||
},
|
|
||||||
"prettier": {
|
|
||||||
"singleQuote": true
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"extends": [
|
|
||||||
"plugin:compat/recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 5
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"quotes": [
|
|
||||||
"error",
|
|
||||||
"single",
|
|
||||||
{
|
|
||||||
"avoidEscape": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-unused-vars": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"args": "none"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"Safari >= 8",
|
|
||||||
"last 2 Chrome versions",
|
|
||||||
"last 2 Firefox versions",
|
|
||||||
"Firefox 68",
|
|
||||||
"last 2 Edge versions",
|
|
||||||
"IE >= 10"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Jasmine Core 1.3.0 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
This version was a very incremental release that merged in some pull requests for bug fixes.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
* HTML Runner exposes UI to not swallow Exceptions, instead raising as soon as thrown
|
|
||||||
* Migrated homepage content to Wiki
|
|
||||||
* Made a far more useful [tutorial page](http://pivotal.github.com/jasmine)
|
|
||||||
* Added a `toBeNaN` matcher
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
* Better detection of in-browser vs. not
|
|
||||||
* `afterEach` functions will run now even when there is a timeout
|
|
||||||
* `toBeCloseTo` matcher is more accurate
|
|
||||||
* More explicit matcher messages for spies
|
|
||||||
* Better equality comparisons for regular expressions
|
|
||||||
* Improvements to the Pretty Printer: controllable recursion depth, don't include inherited properties
|
|
||||||
* Fix where `for` was being used as a property on an object (failed on IE)
|
|
||||||
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# Jasmine Core 1.3.1 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release is for browser compatibility fixes
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
Fixing test runner failures in IE 6/7/8
|
|
||||||
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
# Jasmine Core 2.0.1 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release is for small bug fixes and enhancements ahead of a real-soon-now 2.1.
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* NodeJS is now supported with a jasmine-core npm
|
|
||||||
* [Support browsers that don't supply a `Date.now()` by having a `mockDate` object](http://www.pivotaltracker.com/story/66606132) - Closes #361
|
|
||||||
* [Show message if no specs where loaded](http://www.pivotaltracker.com/story/12784235)
|
|
||||||
* When using `jasmine.any`, the `class` will now be included in the error message
|
|
||||||
* Reporters now receive the number of passed expectations in a spec
|
|
||||||
* Use default failure message for `toBeNaN`
|
|
||||||
* Use the latest `jasmine_selenium_runner` so we use the fix for printing objects with cycles
|
|
||||||
* Add jasmine logo image to HTML runner
|
|
||||||
* Stop Jasmine's CSS affecting the style of the body tag - Closes #600
|
|
||||||
* Standardized location of the standalone distributions - they now live in the repo in `/dist` as well as on the Releases page
|
|
||||||
|
|
||||||
### Bugs
|
|
||||||
|
|
||||||
* Don't allow calling the same done callback multiple times - Fixes #523
|
|
||||||
* [Remove 'empty' as an option as a spec result](http://www.pivotaltracker.com/story/73741032) as this was a breaking change
|
|
||||||
* Instead, we determine if a spec has no expectations using the added
|
|
||||||
key of `passedExpectations` in combination of the `failedExpectations`
|
|
||||||
to determine that there a spec is 'empty'
|
|
||||||
* Fix build in IE8 (IE8 doesn't support `Object.freeze`)
|
|
||||||
* Fix `ObjectContaining` to match recursively
|
|
||||||
|
|
||||||
### Documentation
|
|
||||||
|
|
||||||
* Update release doc to use GitHub releases
|
|
||||||
* Add installation instructions to README - Merges #621
|
|
||||||
* Add Ruby Gem and Python Egg to docs
|
|
||||||
* Add detailed steps on how to contribute - Merges #580 from @pablofiu
|
|
||||||
|
|
||||||
## Pull Requests and Issues
|
|
||||||
|
|
||||||
* Contains is explicitly false if actual is `undefined` or `null` - Fixes #627
|
|
||||||
* namespace `html-reporter` -> `jasmine_html-reporter` - Fixes #600
|
|
||||||
* Throw a more specific error when `expect` is used without a `currentSpec` - Fixes #602
|
|
||||||
* Reduced size of logo with PNG Gauntlet - Merges #588
|
|
||||||
* HTML Reporter resets previous DOM when re-initialized - Merges #594 from @plukevdh
|
|
||||||
* Narrow down raise exceptions query selector; Finding by any input tag is a little bit broad - Closes #605
|
|
||||||
* Pass through custom equality testers in toHaveBeenCalledWith - Fixes #536
|
|
||||||
* Fix outdated copyright year (update to 2014) - Merges #550 from @slothmonster
|
|
||||||
* [Add package.json to Python egg to get correct version number](http://www.pivotaltracker.com/story/67556148) - Fixes #551
|
|
||||||
* Allow users to set the maximum length of array that the pretty-printer
|
|
||||||
will print out - Fixes #323 @mikemoraned and #374 @futuraprime
|
|
||||||
* `matchersUtil.equals()` does not expect a matcher as its first argument,
|
|
||||||
so send the "actual" value first and the "expected" value second. - Merges #538 from @cbandy
|
|
||||||
* Add single quote check to `jshint` and fix src files for that - Closes #522
|
|
||||||
* Remove an `eval` in order to support running jasmine within CSP - Closes #503
|
|
||||||
* Allow matcher custom failure messages to be a function - Closes #520
|
|
||||||
* More color blind friendly CSS from @dleppik - Closes #463 & #509
|
|
||||||
* Use `load-grunt-tasks` Merges #521 from @robinboehm
|
|
||||||
* Special case printing `-0` - Closes #496
|
|
||||||
* Allow stub or spy Date object safely using a closure to get a clean copy - Closes #506
|
|
||||||
* [Use `\d7` instead of plain 'x' for more square appearance](http://www.pivotaltracker.com/story/48434179)
|
|
||||||
* Better support in pretty printer when an object has null prototype - Fixes #500
|
|
||||||
* Update link at top of README to improve access to Jasmine 2.0 docs - Merges #486 from @nextmat
|
|
||||||
* Force query selector to seek within the html-reporter element - Merges #479 from @shprink
|
|
||||||
* Netbeans files are in gitignore - Merges #478 from @shprink
|
|
||||||
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
# Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* keep the files for running in a webpage around in the npm package
|
|
||||||
* Expose files and paths necessary to embed jasmine in an html page for nodejs
|
|
||||||
* Pull out the building of the jasmine interface so node and web both get the same one.
|
|
||||||
* Show a dot with color of pending spec when no expectations
|
|
||||||
* Console reporter prints out failed expectation's message
|
|
||||||
|
|
||||||
### Bugs
|
|
||||||
|
|
||||||
* Allow mocked Date constructor to be called with a subset of full params
|
|
||||||
|
|
||||||
## Pull Requests and Issues
|
|
||||||
|
|
||||||
* a disabled suite should call resultCallback with status being disabled
|
|
||||||
* disabled suite should still call onStart callback
|
|
||||||
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
# Jasmine Core 2.1.0 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is the release of Jasmine 2.1.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- Support for focused specs via `fit` and `fdescribe`
|
|
||||||
- Support for `beforeAll` and `afterAll`
|
|
||||||
- Support for an explicit `fail` function, both in synchronous and asynchronous specs
|
|
||||||
- Allow custom timeout for `beforeEach`, `afterEach`, `beforeAll`, `afterAll` and `it`
|
|
||||||
- Spies now track return values
|
|
||||||
- Specs can now specify their own timeouts
|
|
||||||
- Testing in Node.js via the official Jasmine Node Module
|
|
||||||
- Spec results now have `suiteResults` method that behaves similarly to to `specResults`
|
|
||||||
- HtmlReporter shows error alerts for afterAllExceptions
|
|
||||||
|
|
||||||
## Bugs
|
|
||||||
|
|
||||||
- CI now works for IE8 (this was releated to `ConsoleReporter` below)
|
|
||||||
- Detect global object properly when getting the jasmine require obj
|
|
||||||
- Fixes Issue #[569][issue_569] - [Tracker Story #73684570](http://www.pivotaltracker.com/story/73684570)
|
|
||||||
|
|
||||||
## Deprecations
|
|
||||||
|
|
||||||
### `ConsoleReporter` as part of Jasmine core
|
|
||||||
|
|
||||||
The Console Reporter exists nearly entirely for the old manner of running Jasmine's own specs in node.js. As we are now supporting node.js officially, this reporter code no longer needs to be in this repo and instead will be in the Jasmine npm.
|
|
||||||
|
|
||||||
For now you will see a deprecation message. It will be removed entirely in Jasmine 3.0.
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
- Release Notes from previous releases now live at [Jasmine's GitHub release page][releases]. See Tracker Story #[54582902][tracker_1]
|
|
||||||
- Better instructions for releasing new documentation
|
|
||||||
|
|
||||||
[releases]: https://github.com/pivotal/jasmine/releases
|
|
||||||
[tracker_1]: http://www.pivotaltracker.com/story/54582902
|
|
||||||
|
|
||||||
|
|
||||||
## Pull Requests and Issues
|
|
||||||
|
|
||||||
- Simplification of HTMLtags in SpecRunner.html
|
|
||||||
- Merges #[700][issue_700] from @tkrotoff
|
|
||||||
- `toContain` works with array-like objects (Arguments, HTMLCollections, etc)
|
|
||||||
- Merges #[699][issue_699] from @charleshansen
|
|
||||||
- Fixed isPendingSpecException test title
|
|
||||||
- Merges #[691][issue_691] from @ertrzyiks
|
|
||||||
- Fixed an issue with example code in the npm
|
|
||||||
- Merges #[686][issue_686] from @akoptsov
|
|
||||||
- When the Jasmine clock is installed and date is mocked, `new Date() instanceof Date` should equal `true` Issue #[678][issue_678] & Issue #[679][issue_679] from @chernetsov
|
|
||||||
- Support for an explicit `fail` function, both in synchronous and asynchronous specs
|
|
||||||
- Fixes Issue #[567][issue_567], Issue #[568][issue_568], and Issue #[563][issue_563]
|
|
||||||
- Allow custom timeout for `beforeEach`, `afterEach`, `beforeAll`, `afterAll` and `it`
|
|
||||||
- Fixes Issue #[483][issue_483] - specs can now specify their own timeouts
|
|
||||||
- Spies can track return values
|
|
||||||
- Fixes Issue #[660][issue_660], Merged Issue #[669][issue_669] from @mkhanal
|
|
||||||
- Interval handlers can now clear their interval
|
|
||||||
- Fixes Issue #[655][issue_655] Merged Issue #[658][issue_658] from @tgirardi
|
|
||||||
- Updated to the latest `json2.js`
|
|
||||||
- Merges #[616][issue_616] from @apaladox2015
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with [Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
|
|
||||||
[issue_569]: http://github.com/pivotal/jasmine/issues/569
|
|
||||||
[issue_700]: http://github.com/pivotal/jasmine/issues/700
|
|
||||||
[issue_699]: http://github.com/pivotal/jasmine/issues/699
|
|
||||||
[issue_691]: http://github.com/pivotal/jasmine/issues/691
|
|
||||||
[issue_678]: http://github.com/pivotal/jasmine/issues/678
|
|
||||||
[issue_679]: http://github.com/pivotal/jasmine/issues/679
|
|
||||||
[issue_567]: http://github.com/pivotal/jasmine/issues/567
|
|
||||||
[issue_568]: http://github.com/pivotal/jasmine/issues/568
|
|
||||||
[issue_563]: http://github.com/pivotal/jasmine/issues/563
|
|
||||||
[issue_483]: http://github.com/pivotal/jasmine/issues/483
|
|
||||||
[issue_660]: http://github.com/pivotal/jasmine/issues/660
|
|
||||||
[issue_669]: http://github.com/pivotal/jasmine/issues/669
|
|
||||||
[issue_655]: http://github.com/pivotal/jasmine/issues/655
|
|
||||||
[issue_658]: http://github.com/pivotal/jasmine/issues/658
|
|
||||||
[issue_616]: http://github.com/pivotal/jasmine/issues/616
|
|
||||||
[issue_686]: http://github.com/pivotal/jasmine/issues/686
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Jasmine Core 2.1.1 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a hotfix release of jasmine core to fix a breaking change with events emitted by the top-level suite
|
|
||||||
|
|
||||||
## Issues
|
|
||||||
|
|
||||||
- Top-level suite triggers suiteStarted and suiteEnd to be consistent
|
|
||||||
- Fixes [#706](http://github.com/pivotal/jasmine/issues/706)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Jasmine Core 2.1.2 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a hotfix release of jasmine core to fix a breaking change with reporting when all of the specs in a suite are pending.
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
- Suites still run their children even if none are executable
|
|
||||||
- Fixes [#707](http://github.com/pivotal/jasmine/issues/707)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Jasmine Core 2.1.3 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release is primarily a bug-fix release to clean up some recent regressions.
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Top level suite no longer reports suiteStart and suiteDone
|
|
||||||
- Fixes [#716](https://github.com/jasmine/jasmine/issues/716)
|
|
||||||
|
|
||||||
* Don't keep the expected and actual for a passed expectation
|
|
||||||
- Fixes [#640](https://github.com/jasmine/jasmine/issues/640)
|
|
||||||
- Fixes [#690](https://github.com/jasmine/jasmine/issues/690)
|
|
||||||
|
|
||||||
* Use the new build env on Travis
|
|
||||||
- Merges [#712](https://github.com/jasmine/jasmine/issues/712) from @joshk
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
# Jasmine Core 2.2.0 Release Notes
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* `ObjectContaining` no longer tries to track exact mismatches
|
|
||||||
* HTML reporter keeps extra query params when focusing on a spec or suite
|
|
||||||
* Check custom properties on Arrays when computing equality
|
|
||||||
* Better error message if `spyOn` is called without a method name
|
|
||||||
* Rename `jasmineMatches` to `asymmetricMatch`
|
|
||||||
* Don't double escape focus spec links
|
|
||||||
* Jasmine equality checks if either side implements `asymmetricMatch`
|
|
||||||
* Add asymmetric equality tester to match a string with a RegExp
|
|
||||||
* Add jshint to node build on Travis for pull request builds
|
|
||||||
* Restructure node examples directory to look more realistic
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Add a basic bower config
|
|
||||||
- Fixes [#719](https://github.com/jasmine/jasmine/issues/719)
|
|
||||||
|
|
||||||
* Allow `pending` to take a reason and show it in the HtmlReporter
|
|
||||||
- Fixes [#671](https://github.com/jasmine/jasmine/issues/671)
|
|
||||||
|
|
||||||
* Set jasmineGlobal correctly in GJS
|
|
||||||
- Merges [#757](https://github.com/jasmine/jasmine/issues/757) from @ptomato
|
|
||||||
- Fixes [#751](https://github.com/jasmine/jasmine/issues/751)
|
|
||||||
|
|
||||||
* Fix some SpiderMonkey lint warnings
|
|
||||||
- Merges [#752](https://github.com/jasmine/jasmine/issues/752) from @ptomato
|
|
||||||
- Fixes [#751](https://github.com/jasmine/jasmine/issues/751)
|
|
||||||
|
|
||||||
* Prevents *Alls from running when runnables are explicitly set
|
|
||||||
- Fixes [#732](https://github.com/jasmine/jasmine/issues/732)
|
|
||||||
|
|
||||||
* Update contribution guide to mention possible ffi dependencies for Ubuntu
|
|
||||||
- Fixes [#755](https://github.com/jasmine/jasmine/issues/755)
|
|
||||||
|
|
||||||
* Fix spelling mistake in contributors guide
|
|
||||||
- Merges [#746](https://github.com/jasmine/jasmine/issues/746) from @swirlycheetah
|
|
||||||
|
|
||||||
* Use new jasmine github repo url
|
|
||||||
- Merges [#745](https://github.com/jasmine/jasmine/issues/745) rohit
|
|
||||||
|
|
||||||
* Allow `createSpyObj` to be called with just an array of method names
|
|
||||||
- Fixes [#321](https://github.com/jasmine/jasmine/issues/321)
|
|
||||||
|
|
||||||
* Add `arrayContaining` matcher
|
|
||||||
- Merges [#440](https://github.com/jasmine/jasmine/issues/440) from @slackersoft
|
|
||||||
|
|
||||||
* Use the stack trace from the Error object if supplied
|
|
||||||
- Fixes [#734](https://github.com/jasmine/jasmine/issues/734)
|
|
||||||
|
|
||||||
* Update readme with link to upgrading doc and mention browser support.
|
|
||||||
- Fixes [#739](https://github.com/jasmine/jasmine/issues/739)
|
|
||||||
|
|
||||||
* Link to the Jasmine NPM module
|
|
||||||
- Merges [#736](https://github.com/jasmine/jasmine/issues/736) from @moonmaster9000
|
|
||||||
|
|
||||||
* Allow null prototype objects to be compared for equality
|
|
||||||
- Merges [#731](https://github.com/jasmine/jasmine/issues/731) from @rohit
|
|
||||||
- Fixes [#729](https://github.com/jasmine/jasmine/issues/729)
|
|
||||||
|
|
||||||
* Fix URL's of Jasmine repositories on Github
|
|
||||||
- Merges [#730](https://github.com/jasmine/jasmine/issues/730) from @rohit
|
|
||||||
|
|
||||||
* Add `anything` matcher to match any value that is neither null or undefined
|
|
||||||
- Fixes [#186](https://github.com/jasmine/jasmine/issues/186)
|
|
||||||
|
|
||||||
* Allow asymmetric equality testers to preempt their symmetric brethren
|
|
||||||
- Fixes [#540](https://github.com/jasmine/jasmine/issues/540)
|
|
||||||
|
|
||||||
* Check for `ObjectContaining` on either side of equality
|
|
||||||
- Fixes [#682](https://github.com/jasmine/jasmine/issues/682)
|
|
||||||
|
|
||||||
* Display the name of the constructor when pretty printing objects
|
|
||||||
- Fixes [#598](https://github.com/jasmine/jasmine/issues/598)
|
|
||||||
|
|
||||||
* `toMatch` requires the `expected` to be a String or RegExp
|
|
||||||
- Fixes [#723](https://github.com/jasmine/jasmine/issues/723)
|
|
||||||
|
|
||||||
* Better equality comparison of Dom nodes
|
|
||||||
- Merges [#657](https://github.com/jasmine/jasmine/issues/657) from @alexeibs
|
|
||||||
|
|
||||||
* Hide unnecessary files from the npm package
|
|
||||||
- Fixes [#726](https://github.com/jasmine/jasmine/issues/726)
|
|
||||||
|
|
||||||
* Properly record finishing an `xdescribe` so further cleanup works
|
|
||||||
- Fixes [#724](https://github.com/jasmine/jasmine/issues/724)
|
|
||||||
|
|
||||||
* Reschedule all functions for a tick before executing any. This allows any function run during a tick to cancel any other in the same tick.
|
|
||||||
- Fixes [#708](https://github.com/jasmine/jasmine/issues/708)
|
|
||||||
|
|
||||||
* Pass through all args from external interface for befores, afters, its
|
|
||||||
- Fixes [#483](https://github.com/jasmine/jasmine/issues/483)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# Jasmine Core 2.2.1 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a hotfix release to fix the packaging for bower
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Fix missing comma on bower.json
|
|
||||||
- Merges [#763](https://github.com/jasmine/jasmine/issues/763) from @gabrielhpugliese
|
|
||||||
- Merges [#764](https://github.com/jasmine/jasmine/issues/764) from @joshuacc
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
# Jasmine Core 2.3.0 Release Notes
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Style disabled specs in the results list
|
|
||||||
* Use `onclick` directly to better support older webkit
|
|
||||||
* Don't use deprecated `onComplete` syntax for jasmine-npm
|
|
||||||
* Allow the clock to be installed for the duration of a single closure
|
|
||||||
* Add safari 7 & 8 to browser matrix
|
|
||||||
* Remove unused standaloneBuilder var from Gruntfile
|
|
||||||
* Add test script to package.json
|
|
||||||
* Update bower.json keywords to match package.json keywords
|
|
||||||
* Add keywords to package.json
|
|
||||||
* refuse to execute an order if it would cause a suite with a beforeAll or afterAll to be re-entered after leaving once
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Specify a main entry point for bower so it can be loaded easier
|
|
||||||
- Merges [#827](https://github.com/jasmine/jasmine/issues/827) from @davetron5000
|
|
||||||
|
|
||||||
* Use `instanceof` when checking Error types in toThrowError
|
|
||||||
- Fixes [#819](https://github.com/jasmine/jasmine/issues/819)
|
|
||||||
|
|
||||||
* Remove periods from bullet points for consistency with rest of document
|
|
||||||
- Merge [#818](https://github.com/jasmine/jasmine/issues/818) from @lpww
|
|
||||||
|
|
||||||
* Subjective readability improvements to CONTRIBUTING.md
|
|
||||||
- Merge [#815](https://github.com/jasmine/jasmine/issues/815) from @jhamon
|
|
||||||
|
|
||||||
* Don't install the clock if the current timing functions aren't the originals
|
|
||||||
- Fixes [#782](https://github.com/jasmine/jasmine/issues/782)
|
|
||||||
|
|
||||||
* Properly pass `j$` to `Any` so it can use other jasmine stuff
|
|
||||||
- Fixes [#806](https://github.com/jasmine/jasmine/issues/806)
|
|
||||||
|
|
||||||
* Correctly handle functions that are scheduled after the clock is uninstalled and reinstalled from within Clock#tick.
|
|
||||||
- Merges [#804](https://github.com/jasmine/jasmine/issues/804) from @sgravrock
|
|
||||||
- Fixes [#790](https://github.com/jasmine/jasmine/issues/790).
|
|
||||||
|
|
||||||
* Allow user to stop a specs execution when an expectation fails
|
|
||||||
- Fixes [#577](https://github.com/jasmine/jasmine/issues/577)
|
|
||||||
|
|
||||||
* Remove unnecessary conditional
|
|
||||||
- Merges [#788](https://github.com/jasmine/jasmine/issues/788) from @toddbranch
|
|
||||||
|
|
||||||
* Show the name of the constructor function when printing an `any` instead of a `toString` of the entire constructor
|
|
||||||
- Fixes [#796](https://github.com/jasmine/jasmine/issues/796)
|
|
||||||
|
|
||||||
* Don't use hardcoded temporary directory paths
|
|
||||||
- Merges [#789](https://github.com/jasmine/jasmine/issues/789) from sgravrock
|
|
||||||
|
|
||||||
* Execute beforeAll/afterAll once per suite instead of once per child when running focused specs/suites
|
|
||||||
- Fixes [#773](https://github.com/jasmine/jasmine/issues/773)
|
|
||||||
|
|
||||||
* Report children of an xdescribe similarly to how they would be reported if they were themselves x'd out
|
|
||||||
- Fixes [#774](https://github.com/jasmine/jasmine/issues/774)
|
|
||||||
- Fixes [#776](https://github.com/jasmine/jasmine/issues/776)
|
|
||||||
|
|
||||||
* Fixes issue where mock clock was being used by QueueRunner
|
|
||||||
- Fixes [#783](https://github.com/jasmine/jasmine/issues/783)
|
|
||||||
- Fixes [#792](https://github.com/jasmine/jasmine/issues/792)
|
|
||||||
|
|
||||||
* add missing semicolon
|
|
||||||
- Merges [#775](https://github.com/jasmine/jasmine/issues/775) from @joscha
|
|
||||||
|
|
||||||
* ObjectContaining matches prototype properties
|
|
||||||
- Fixes [#769](https://github.com/jasmine/jasmine/issues/769)
|
|
||||||
|
|
||||||
* Updates pretty printer to include array properties
|
|
||||||
- Fixes [#766](https://github.com/jasmine/jasmine/issues/766)
|
|
||||||
|
|
||||||
* Update year copyright
|
|
||||||
- Merges [#768](https://github.com/jasmine/jasmine/issues/768) from @danilovaz
|
|
||||||
|
|
||||||
* Allow arrays from different frames or contexts to be equal
|
|
||||||
- Merges [#767](https://github.com/jasmine/jasmine/issues/767) from @juliemr
|
|
||||||
- Fixes [#765](https://github.com/jasmine/jasmine/issues/765)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Jasmine 2.3.1 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release is a packaging update for bower only.
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Point Bower's main field to jasmine.js, which is browser-friendly.
|
|
||||||
- Merge [#843](https://github.com/jasmine/jasmine/issues/843) from @evoL
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Jasmine 2.3.2 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a hotfix release to fix a regression with specs declared without a function body
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* A spec without a function provided should be `pending` not `disabled`
|
|
||||||
- Fixes [#840](https://github.com/jasmine/jasmine/issues/840)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Jasmine 2.3.3 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a hotfix release to fix a regression with the execution context for `beforeAll`
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Set the shared user context correctly when executing the top level suite
|
|
||||||
- Fixes [#846](https://github.com/jasmine/jasmine/issues/846)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Jasmine 2.3.4 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a hotfix release to fix a regression with execution ordering
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Fix ordering for suites with more than 11 direct children.
|
|
||||||
- Fixes [#850](https://github.com/jasmine/jasmine/issues/850)
|
|
||||||
|
|
||||||
* Update standalone installation instructions to reference the releases page
|
|
||||||
- Fixes [#603](https://github.com/jasmine/jasmine/issues/603)
|
|
||||||
|
|
||||||
* Remove dead CSS class styles
|
|
||||||
- Merges [#849](https://github.com/jasmine/jasmine/issues/849) from @prather-mcs
|
|
||||||
- Merges [#848](https://github.com/jasmine/jasmine/issues/848) from @prather-mcs
|
|
||||||
- Fixes [#847](https://github.com/jasmine/jasmine/issues/847)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
# Jasmine Core 2.4.0 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release contains a number of fixes and pull requests.
|
|
||||||
The most notable is probably that Jasmine now supports randomization of spec order
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Run jasmine's specs in random order
|
|
||||||
* Add support for returning run details for reporting randomness
|
|
||||||
* Use className instead of class when creating DOM elements
|
|
||||||
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Syntax highlighting in README.md
|
|
||||||
- Merges [#973](https://github.com/jasmine/jasmine/issues/973) from @brunoqc
|
|
||||||
|
|
||||||
* Added a throw error block in describe incase a function with arguments is passed in describe
|
|
||||||
- Fixes [#896](https://github.com/jasmine/jasmine/issues/896)
|
|
||||||
- Merges [#955](https://github.com/jasmine/jasmine/issues/955) from @himajasuman
|
|
||||||
|
|
||||||
* Remove unused `queueableFn` arg from `onException`
|
|
||||||
- Fixes [#958](https://github.com/jasmine/jasmine/issues/958)
|
|
||||||
|
|
||||||
* Remove unused parameter from toThrowError
|
|
||||||
- Merges [#957](https://github.com/jasmine/jasmine/issues/957) from @FuzzySockets
|
|
||||||
|
|
||||||
* Abort spying when the target cannot be spied upon
|
|
||||||
- Fixes [#948](https://github.com/jasmine/jasmine/issues/948)
|
|
||||||
- Merges [#949](https://github.com/jasmine/jasmine/issues/949) from @StephanBijzitter
|
|
||||||
|
|
||||||
* Removed GOALS_2.0.md, doesn't seem to be needed anymore
|
|
||||||
- Merges [#954](https://github.com/jasmine/jasmine/issues/954) from @matthewhuff89
|
|
||||||
|
|
||||||
* Change #xit so that it will output a more BDD-style pending message
|
|
||||||
- Merges [#942](https://github.com/jasmine/jasmine/issues/942) from @lalunamel
|
|
||||||
- Fixes [#930](https://github.com/jasmine/jasmine/issues/930)
|
|
||||||
- Fixes [#912](https://github.com/jasmine/jasmine/issues/912)
|
|
||||||
|
|
||||||
* Allow tests to run in random order
|
|
||||||
- Merges [#927](https://github.com/jasmine/jasmine/issues/927) from @marcioj
|
|
||||||
|
|
||||||
* Use toString for objects if it has been overriden
|
|
||||||
- Merges [#929](https://github.com/jasmine/jasmine/issues/929) from @myitcv
|
|
||||||
- Fixes [#928](https://github.com/jasmine/jasmine/issues/928)
|
|
||||||
|
|
||||||
* Fix circles/x from getting cut off on Mac/chrome
|
|
||||||
- Merges [#932](https://github.com/jasmine/jasmine/issues/932) from @James-Dunn
|
|
||||||
|
|
||||||
* Postpone find() until it is needed
|
|
||||||
- Merges [#924](https://github.com/jasmine/jasmine/issues/924) from @danielalexiuc
|
|
||||||
- Fixes [#917](https://github.com/jasmine/jasmine/issues/917)
|
|
||||||
|
|
||||||
* check for global before assigning
|
|
||||||
* Reverse suite afterEach behavior to match semantics?
|
|
||||||
- Merges [#908](https://github.com/jasmine/jasmine/issues/908) from @mcamac
|
|
||||||
|
|
||||||
* Use badges from shields.io
|
|
||||||
- Merges [#902](https://github.com/jasmine/jasmine/issues/902) from @SimenB
|
|
||||||
|
|
||||||
* xdescribe marks pending, plus associated tests.
|
|
||||||
- Merges [#869](https://github.com/jasmine/jasmine/issues/869) from @ljwall
|
|
||||||
- Fixes [#855](https://github.com/jasmine/jasmine/issues/855)
|
|
||||||
|
|
||||||
* Update glob to latest
|
|
||||||
- Merge [#892](https://github.com/jasmine/jasmine/issues/892) from @obastemur
|
|
||||||
- Fixes [#891](https://github.com/jasmine/jasmine/issues/891)
|
|
||||||
|
|
||||||
* Remove moot `version` property from bower.json
|
|
||||||
- Merges [#874](https://github.com/jasmine/jasmine/issues/874) from @kkirsche
|
|
||||||
|
|
||||||
* add toHaveBeenCalledTimes matcher
|
|
||||||
- Merges [#871](https://github.com/jasmine/jasmine/issues/871) from @logankd
|
|
||||||
- Fixes [#853](https://github.com/jasmine/jasmine/issues/853)
|
|
||||||
|
|
||||||
* Update CONTRIBUTING.md
|
|
||||||
- Merges [#856](https://github.com/jasmine/jasmine/issues/856) from @lpww
|
|
||||||
|
|
||||||
* Make the HtmlReport CSS classes "unique enough"
|
|
||||||
- Merges [#851](https://github.com/jasmine/jasmine/issues/851) from @prather-mcs
|
|
||||||
- Fixes [#844](https://github.com/jasmine/jasmine/issues/844)
|
|
||||||
|
|
||||||
* Raise an error when jasmine.any() isn't passed a constructor
|
|
||||||
- Merges [#854](https://github.com/jasmine/jasmine/issues/854) from @danfinnie
|
|
||||||
- Fixes [#852](https://github.com/jasmine/jasmine/issues/852)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
# Jasmine Core 2.4.1 Release Notes
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Run `afterEach` in reverse order declared as before
|
|
||||||
- Reverts [#908](https://github.com/jasmine/jasmine/issues/908)
|
|
||||||
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
# Jasmine 2.5.0 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release contains a number of fixes and pull requests.
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Rename `j$` to `jasmineUnderTest` for specs
|
|
||||||
- Please update any pull requests to simplify merging, thanks.
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Prettyprint objects whose constructors have custom toString method
|
|
||||||
- Fixes [#1019](https://github.com/jasmine/jasmine/issues/1019)
|
|
||||||
- Merges [#1099](https://github.com/jasmine/jasmine/issues/1099) from @mbildner
|
|
||||||
|
|
||||||
* Add gulp-jasmine-browser link to readme
|
|
||||||
- Fixes [#1089](https://github.com/jasmine/jasmine/issues/1089)
|
|
||||||
|
|
||||||
* Exclude lib directory from codeclimate
|
|
||||||
- Fixes [#1171](https://github.com/jasmine/jasmine/issues/1171)
|
|
||||||
|
|
||||||
* Add instructions for testing in IE
|
|
||||||
- Merges [#1170](https://github.com/jasmine/jasmine/issues/1170) from @benchristel
|
|
||||||
|
|
||||||
* Update devDependencies and fix issues from this
|
|
||||||
- Merges [#1162](https://github.com/jasmine/jasmine/issues/1162) from @amavisca
|
|
||||||
|
|
||||||
* Remove runnableLookupTable which is no longer used
|
|
||||||
- Merges [#1129](https://github.com/jasmine/jasmine/issues/1129) from @gregeninfrank
|
|
||||||
|
|
||||||
* Make `toEqual` pass for arrays with equivalent properties
|
|
||||||
- Merges [#1155](https://github.com/jasmine/jasmine/issues/1155) from @benchristel
|
|
||||||
|
|
||||||
* Update ruby version on travis to let rack install
|
|
||||||
- Merges [#1152](https://github.com/jasmine/jasmine/issues/1152) from @amavisca
|
|
||||||
|
|
||||||
* Fix jasmine setup in Electron environment
|
|
||||||
- Merges [#1079](https://github.com/jasmine/jasmine/issues/1079) from @skupr
|
|
||||||
- Fixes [#964](https://github.com/jasmine/jasmine/issues/964)
|
|
||||||
|
|
||||||
* Improve errors with the domain and how to use the API
|
|
||||||
- Merges [#1026](https://github.com/jasmine/jasmine/issues/1026) from @dhoko
|
|
||||||
- Fixes [#1025](https://github.com/jasmine/jasmine/issues/1025)
|
|
||||||
|
|
||||||
* The done function now returns null
|
|
||||||
- Merges [#1062](https://github.com/jasmine/jasmine/issues/1062) from @marneborn
|
|
||||||
- Fixes [#992](https://github.com/jasmine/jasmine/issues/992)
|
|
||||||
|
|
||||||
* Add .editorconfig file
|
|
||||||
- Merges [#1058](https://github.com/jasmine/jasmine/issues/1058) from @kapke
|
|
||||||
- Fixes [#1057](https://github.com/jasmine/jasmine/issues/1057)
|
|
||||||
|
|
||||||
* Improve error message when passing a non-function to callFake
|
|
||||||
- Merges [#1059](https://github.com/jasmine/jasmine/issues/1059) from @kapke
|
|
||||||
- Fixes [#1016](https://github.com/jasmine/jasmine/issues/1016)
|
|
||||||
|
|
||||||
* Allow expectations in a global beforeAll or afterAll
|
|
||||||
- Fixes [#811](https://github.com/jasmine/jasmine/issues/811)
|
|
||||||
|
|
||||||
* Correctly tear down spies on inherited methods
|
|
||||||
- Merges [#1036](https://github.com/jasmine/jasmine/issues/1036) from @benchristel
|
|
||||||
- Fixes [#737](https://github.com/jasmine/jasmine/issues/737)
|
|
||||||
|
|
||||||
* Array equality treats undefined elements as equal however they got in there
|
|
||||||
- Fixes [#786](https://github.com/jasmine/jasmine/issues/786)
|
|
||||||
|
|
||||||
* Add support for a fallback reporter
|
|
||||||
- Merges [#1009](https://github.com/jasmine/jasmine/issues/1009) from @mauricioborges
|
|
||||||
|
|
||||||
* Grunt task for compass should prefix command with 'bundle exec'
|
|
||||||
- Merges [#1047](https://github.com/jasmine/jasmine/issues/1047) from @d-reinhold
|
|
||||||
|
|
||||||
* Fix `toEqual` for Microsoft Edge
|
|
||||||
- Merges [#1041](https://github.com/jasmine/jasmine/issues/1041) from @everedifice
|
|
||||||
|
|
||||||
* Update describe error message to no longer assume errant args are `done`
|
|
||||||
- Fixes [#896](https://github.com/jasmine/jasmine/issues/896)
|
|
||||||
|
|
||||||
* Add toBeGreatThanOrEqual and toBeLessThanOrEqual matchers
|
|
||||||
- Merges [#1049](https://github.com/jasmine/jasmine/issues/1049) from @rullopat
|
|
||||||
- Fixes [#1013](https://github.com/jasmine/jasmine/issues/1013)
|
|
||||||
|
|
||||||
* Support call count of 0 with toHaveBeenCalledTimes matcher
|
|
||||||
- Merges [#1048](https://github.com/jasmine/jasmine/issues/1048) from @logankd
|
|
||||||
- Fixes [#994](https://github.com/jasmine/jasmine/issues/994)
|
|
||||||
|
|
||||||
* Correctly clean up spies after a spy is replaced and re-spied upon
|
|
||||||
- Merges [#1011](https://github.com/jasmine/jasmine/issues/1011) from @bodawei
|
|
||||||
- Fixes [#1010](https://github.com/jasmine/jasmine/issues/1010)
|
|
||||||
|
|
||||||
* remove extra topSuite `queueRunner` construction parameter
|
|
||||||
- Merges [#1006](https://github.com/jasmine/jasmine/issues/1006) from @jurko-gospodnetic
|
|
||||||
|
|
||||||
* add option to shallow clone args in call tracker
|
|
||||||
- Merges [#1000](https://github.com/jasmine/jasmine/issues/1000) from @a-r-d
|
|
||||||
- Fixes [#872](https://github.com/jasmine/jasmine/issues/872)
|
|
||||||
|
|
||||||
* Update license year range to 2016
|
|
||||||
- Merges [#1021](https://github.com/jasmine/jasmine/issues/1021) from pra85
|
|
||||||
|
|
||||||
* Persist randomize param in 'run all' links
|
|
||||||
- Merges [#990](https://github.com/jasmine/jasmine/issues/990) from @basawyer
|
|
||||||
|
|
||||||
* make DelayedFunctionScheduler update the mockDate
|
|
||||||
- Fixes [#915](https://github.com/jasmine/jasmine/issues/915)
|
|
||||||
- Merges [#980](https://github.com/jasmine/jasmine/issues/980) from @andrewiggings
|
|
||||||
|
|
||||||
* Allow `spyOn` to allow a respy for functions that have already been spied upon
|
|
||||||
- Merges [#953](https://github.com/jasmine/jasmine/issues/953) from @guy-mograbi-at-gigaspaces
|
|
||||||
- Fixes [#931](https://github.com/jasmine/jasmine/issues/931)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# Jasmine 2.5.1 Release Notes
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* fallback on assignment when a spy cannot be deleted
|
|
||||||
- Merges [#1193](https://github.com/jasmine/jasmine/issues/1193) from @seanparmlee
|
|
||||||
- Fixes [#1189](https://github.com/jasmine/jasmine/issues/1189)
|
|
||||||
|
|
||||||
* Fix issue with equality of Arrays in PhantomJS
|
|
||||||
- Merges [#1192](https://github.com/jasmine/jasmine/issues/1192) from @logankd
|
|
||||||
- Fixes [#1188](https://github.com/jasmine/jasmine/issues/1188)
|
|
||||||
|
|
||||||
* Properly tick date along with clock
|
|
||||||
- Fixes [#1190](https://github.com/jasmine/jasmine/issues/1190)
|
|
||||||
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Jasmine 2.5.2 Release Notes
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Allow currently registered reporters to be cleared
|
|
||||||
- [jasmine/jasmine-npm#88](https://github.com/jasmine/jasmine-npm/issues/88)
|
|
||||||
|
|
||||||
|
|
||||||
* Use `isFunction` to check for functionness in `callFake`
|
|
||||||
- Fixes [#1191](https://github.com/jasmine/jasmine/issues/1191)
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
# Jasmine 2.6.0 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This release contains a number of fixes and pull requests.
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
Updating introduction url to last version
|
|
||||||
- Merges [#1316](https://github.com/jasmine/jasmine/issues/1316) from @rachelcarmena
|
|
||||||
|
|
||||||
* Throw a recognizable Error message when `fail` outside of a spec.
|
|
||||||
- Fixes [#1017](https://github.com/jasmine/jasmine/issues/1017)
|
|
||||||
|
|
||||||
* Allow the matcher provide a custom error message
|
|
||||||
- Merges [#1298](https://github.com/jasmine/jasmine/issues/1298) from @deckar01
|
|
||||||
- Fixes [#1123](https://github.com/jasmine/jasmine/issues/1123)
|
|
||||||
|
|
||||||
* Fix the order in which afterAll hooks are run to match afterEach
|
|
||||||
- Merges [#1312](https://github.com/jasmine/jasmine/issues/1312) from @gdborton
|
|
||||||
- Fixes [#1311](https://github.com/jasmine/jasmine/issues/1311)
|
|
||||||
|
|
||||||
* Add matchers for positive and negative infinity
|
|
||||||
- Merges [#1300](https://github.com/jasmine/jasmine/issues/1300) from @toubou91
|
|
||||||
- Fixes [#1294](https://github.com/jasmine/jasmine/issues/1294)
|
|
||||||
|
|
||||||
* Add a first pass at JSDocs for the intended public API
|
|
||||||
- Fixes [#596](https://github.com/jasmine/jasmine/issues/596)
|
|
||||||
|
|
||||||
* Pretty print objects passed to fail method
|
|
||||||
- Merges [#1283](https://github.com/jasmine/jasmine/issues/1283) from @mmmichl
|
|
||||||
- Fixes [#1090](https://github.com/jasmine/jasmine/issues/1090)
|
|
||||||
|
|
||||||
* Properly check for Error constructor from a different frame
|
|
||||||
- Merges [#1275](https://github.com/jasmine/jasmine/issues/1275) from @anseki
|
|
||||||
- Fixes [#1252](https://github.com/jasmine/jasmine/issues/1252)
|
|
||||||
|
|
||||||
* Add toHaveBeenCalledBefore matcher
|
|
||||||
- Merges [#1242](https://github.com/jasmine/jasmine/issues/1242) from @DamienCassou
|
|
||||||
|
|
||||||
* Collect unhandled exceptions and pass them to the current runnable
|
|
||||||
- Fixes [#529](https://github.com/jasmine/jasmine/issues/529)
|
|
||||||
- Fixes [#937](https://github.com/jasmine/jasmine/issues/937)
|
|
||||||
|
|
||||||
* Nicer error messages for `spyOn` when `null` is provided
|
|
||||||
- Fixes [#1258](https://github.com/jasmine/jasmine/issues/1258)
|
|
||||||
|
|
||||||
* Require arguments to beforeEach, it, etc, to be actual functions
|
|
||||||
- Merges [#1222](https://github.com/jasmine/jasmine/issues/1222) from @voithos
|
|
||||||
- Fixes [#1004](https://github.com/jasmine/jasmine/issues/1004)
|
|
||||||
|
|
||||||
* Update MIT.LICENSE for new year
|
|
||||||
- Merges [#1249](https://github.com/jasmine/jasmine/issues/1249) from @Scottkao85
|
|
||||||
|
|
||||||
* Update README.md for new year
|
|
||||||
- Merges [#1248](https://github.com/jasmine/jasmine/issues/1248) from @Nebojsaa
|
|
||||||
|
|
||||||
* Remove unused `message` param from Suite#pend
|
|
||||||
- See [#1132](https://github.com/jasmine/jasmine/issues/1132)
|
|
||||||
|
|
||||||
* Fix bug where before/afterAll were being executed in disabled suites.
|
|
||||||
- Merges [#1225](https://github.com/jasmine/jasmine/issues/1225) from @voithos
|
|
||||||
- Fixes [#1175](https://github.com/jasmine/jasmine/issues/1175)
|
|
||||||
|
|
||||||
* Make toEqual matcher report the difference between objects
|
|
||||||
- Merges [#1163](https://github.com/jasmine/jasmine/issues/1163) from @benchristel
|
|
||||||
- Fixes [#675](https://github.com/jasmine/jasmine/issues/675)
|
|
||||||
- Merges [#1236](https://github.com/jasmine/jasmine/issues/1236) from @benchristel
|
|
||||||
|
|
||||||
|
|
||||||
* Implement spies for get/set functions on accessor properties
|
|
||||||
- Merges [#1203](https://github.com/jasmine/jasmine/issues/1203) from @celluj34
|
|
||||||
- Merges [#1008](https://github.com/jasmine/jasmine/issues/1008) from @smacker
|
|
||||||
- Fixes [#943](https://github.com/jasmine/jasmine/issues/943)
|
|
||||||
|
|
||||||
* When the HtmlReporter has a 'spec' query param, the spec list only shows matching specs/suites
|
|
||||||
- Merges [#1046](https://github.com/jasmine/jasmine/issues/1046) from @d-reinhold
|
|
||||||
- Fixes [#510](https://github.com/jasmine/jasmine/issues/510)
|
|
||||||
|
|
||||||
* createSpyObj may use object for method/response shorthand
|
|
||||||
- Merges [#1101](https://github.com/jasmine/jasmine/issues/1101) from @mbildner
|
|
||||||
|
|
||||||
* Separate clear stack and run it after each spec
|
|
||||||
- Fixes [#985](https://github.com/jasmine/jasmine/issues/985)
|
|
||||||
- Fixes [#945](https://github.com/jasmine/jasmine/issues/945)
|
|
||||||
- Fixes [#366](https://github.com/jasmine/jasmine/issues/366)
|
|
||||||
|
|
||||||
* Now spies preserve original function arity
|
|
||||||
- Merges [#1055](https://github.com/jasmine/jasmine/issues/1055) from @kapke
|
|
||||||
- Fixes [#991](https://github.com/jasmine/jasmine/issues/991)
|
|
||||||
|
|
||||||
* Added support for ES6 sets to toContain and toEqual.
|
|
||||||
- Merges [#1067](https://github.com/jasmine/jasmine/issues/1067) from @alur
|
|
||||||
|
|
||||||
* Correctly pretty print objects from other contexts (e.g. iframes) and which do not override toString
|
|
||||||
- Merges [#1091](https://github.com/jasmine/jasmine/issues/1091) from @thatfulvioguy
|
|
||||||
- Fixes [#1087](https://github.com/jasmine/jasmine/issues/1087)
|
|
||||||
|
|
||||||
* Pass custom testers to asymmetric testers
|
|
||||||
- Merges [#1139](https://github.com/jasmine/jasmine/issues/1139) from @joeyparrish
|
|
||||||
- Fixes [#1138](https://github.com/jasmine/jasmine/issues/1138)
|
|
||||||
|
|
||||||
* Fix bad url in README
|
|
||||||
- Merges [#1215](https://github.com/jasmine/jasmine/issues/1215) from @mattc41190
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
# Jasmine 2.6.1 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a patch release to fix some regressions in the 2.6.0 release
|
|
||||||
|
|
||||||
## Pull Requests & Issues
|
|
||||||
|
|
||||||
* Update README.md to make installation instructions more version-agnostic
|
|
||||||
- Merges #1319 from @reinrl
|
|
||||||
|
|
||||||
* Check for `process.listeners` as well, for GlobalErrors
|
|
||||||
- Fixes #1333
|
|
||||||
|
|
||||||
* allow explicit undefined as function for `it` and `xit`
|
|
||||||
- Merges #1329 from @UziTech
|
|
||||||
- Fixes #1328
|
|
||||||
|
|
||||||
* remove eval to create spy wrapper
|
|
||||||
- Merges #1330 from @UziTech
|
|
||||||
- Fixes #1325
|
|
||||||
|
|
||||||
* iterate through keys with a regular for loop
|
|
||||||
- Merges #1326 from @seanparmelee
|
|
||||||
- Fixes #1321
|
|
||||||
- Fixes #1324
|
|
||||||
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# Jasmine 2.6.2 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a patch release to fix some regressions and performance problems in the 2.6.0 release
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Clear the stack if onmessage is called before the previous invocation finishes
|
|
||||||
- Fixes #1327
|
|
||||||
- Fixes jasmine/gulp-jasmine-browser#48
|
|
||||||
|
|
||||||
* Correctly route errors that occur while a QueueRunner is clearing stack
|
|
||||||
- Merges #1352 from @sgravrock
|
|
||||||
- Fixes #1344
|
|
||||||
- Fixes #1349
|
|
||||||
|
|
||||||
* Don't mask errors that occur when no handlers are installed
|
|
||||||
- Merges #1347 from @sgravrock
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
# Jasmine 2.6.3 Release Notes
|
|
||||||
|
|
||||||
## Summary
|
|
||||||
|
|
||||||
This is a patch release to fix some regressions and performance problems in the 2.6.0 release
|
|
||||||
|
|
||||||
## Changes
|
|
||||||
|
|
||||||
* Make sure the queue runner goes async for async specs
|
|
||||||
- Fixes [#1327](https://github.com/jasmine/jasmine/issues/1327)
|
|
||||||
- Fixes [#1334](https://github.com/jasmine/jasmine/issues/1334)
|
|
||||||
- Fixes [jasmine/gulp-jasmine-browser#48](https://github.com/jasmine/gulp-jasmine-browser/issues/48)
|
|
||||||
|
|
||||||
|
|
||||||
------
|
|
||||||
|
|
||||||
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user