2018-05-16 admin


什么是jasmine,Official packaging of Jasmine's core files for use by Node.js projects.


<a name=“user-content-README”></a>

Build StatusOpen Source Helpers

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 projects, or anywhere that JavaScript can run.

Documentation & guides live here: http://jasmine.github.io For a quick start guide of Jasmine, see the beginning of http://jasmine.github.io/edge/introduction.html

Upgrading from Jasmine 2.x? Check out the 3.0 release notes for a list of what’s new (including breaking changes).


Please read the contributors’ guide


For the Jasmine NPM module: https://github.com/jasmine/jasmine-npm

For the Jasmine Ruby Gem: https://github.com/jasmine/jasmine-gem

For the Jasmine Python Egg: https://github.com/jasmine/jasmine-py

For the Jasmine headless browser gulp plugin: https://github.com/jasmine/gulp-jasmine-browser

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
  • 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:

<link rel="shortcut icon" type="image/png" href="jasmine/lib/jasmine-{#.#.#}/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine-{#.#.#}/jasmine.css">

<script type="text/javascript" src="jasmine/lib/jasmine-{#.#.#}/jasmine.js"></script>
<script type="text/javascript" src="jasmine/lib/jasmine-{#.#.#}/jasmine-html.js"></script>
<script type="text/javascript" src="jasmine/lib/jasmine-{#.#.#}/boot.js"></script>

Supported environments

Jasmine tests itself across many browsers (Safari, Chrome, Firefox, PhantomJS, Microsoft Edge, and new Internet Explorer) as well as nodejs. To see the exact version tests are run against look at our .travis.yml



Maintainers Emeritus

Copyright © 2008-2018 Pivotal Labs. This software is licensed under the MIT License.


转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]



Force-failing a Jasmine test
Ben提出了一个问题:Force-failing a Jasmine test,或许与您遇到的问题类似。 回答者Michael LaffargueMichael Radionov给出了该问题的处理方式: Jasmine provides a...
Angular unit testing with Jasmine: how to remove or modify spyOn
emersonthis提出了一个问题:Angular unit testing with Jasmine: how to remove or modify spyOn,或许与您遇到的问题类似。 回答者Peter Ashwell给出了该问题的...
Output jasmine test results to the console
Yosi提出了一个问题:Output jasmine test results to the console,或许与您遇到的问题类似。 回答者Tigraine给出了该问题的处理方式: Have you tried the ConsoleRe...
Does Jasmine&apos;s toThrow matcher require the argument to be wrapped in an anonymous function?
Communitybrahn提出了一个问题:Does Jasmine’s toThrow matcher require the argument to be wrapped in an anonymous function?,或许与您遇到...
ReferenceError: module is not defined - Karma/Jasmine configuration with Angular/Laravel app
Raphael Rafatpanah提出了一个问题:ReferenceError: module is not defined - Karma/Jasmine configuration with Angular/Laravel app,或...
JavaScript code coverage with Jasmine [closed]
hopperuser153410提出了一个问题:JavaScript code coverage with Jasmine [closed],或许与您遇到的问题类似。 回答者kefir500Andreas Köberle给出了该问题的处理方...
How to reuse beforeEach/afterEach in Jasmine JS?
Adi Roiban提出了一个问题:How to reuse beforeEach/afterEach in Jasmine JS?,或许与您遇到的问题类似。 回答者CommunityLeo Gallucci给出了该问题的处理方式: I t...
Need proper reporter for karma jasmine
blockloop提出了一个问题:Need proper reporter for karma jasmine,或许与您遇到的问题类似。 回答者blockloop给出了该问题的处理方式: Fixed by installing the ka...
AngularJS Promise Callback Not Trigged in JasmineJS Test
Community提出了一个问题:AngularJS Promise Callback Not Trigged in JasmineJS Test,或许与您遇到的问题类似。 回答者Michael Benford给出了该问题的处理方式: TL...