Giter VIP home page Giter VIP logo

jasmine-jstd-adapter's People

Contributors

corbinrsmith avatar cpojer avatar danielstocks avatar ibolmo avatar igorminar avatar mhevery avatar reesd avatar sullimander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jasmine-jstd-adapter's Issues

"Doubling up" of tests - Old results hanging around

This is an odd issue to explain, but I'll try to do it as best I can.

Whenever I change my tests, JsTestDriver seems to "cache" the old tests, and combine the old results with the new results. As an example, one of my spec files has 7 tests in it. This works fine the first time I run JsTestDriver, and also works fine on a second run without changing anything. However, if I change my spec file (even insignificantly - ie. adding whitespace) and run the tests again, JsTestDriver now says I have 14 tests!

If I change a test to fail intentionally and then change it back so it passes, the fail remains and appears on every single test run, until I restart the JsTestDriver server.

I'm using Jasmine 1.1.0, JsTestDriver 1.1.3d, Prototype 1.7, and the Jasmine Prototype adapter.

testing modules without names should be supported

Hello,
I already filed that problem http://code.google.com/p/js-test-driver/issues/detail?id=428&can=1&sort=-id but the rejected it and told me to report it to you... so is it a problem of the adapter?

Prerequisites
curl.js + jasmine

  1. create a js-Module without giving it a name:

    ---- src/Crap.js ------------
    define(function() {
    return function() {
    return "Hello World";
    }

    });

  2. create a test for testing that module (I use jasmine as testing-framework):
    ---- test/Crap.test.js ------
    curl(["Crap"], function(Crap) {
    describe("Crap-Test", function() {
    it("shouasdld write Hello World", function() {
    expect(Crap()).toBe("Hallo Welt");
    });
    })

    });

  3. create a suitable jsTestDriver.conf and provide the needed files as shown
    load:

    • lib/curl/src/curl.js
    • lib/jasmine-1.3.1/jasmine.js
    • lib/jasmine-1.3.1/JasmineAdapter.js
    • test/*.js
    • src/*.js
      test:
    • test/Crap.test.js
  4. run the test

What is the expected output? What do you see instead?
One test should fail but instead
jsTestDriver can't find the 'Crap' Module, throwing:
No tests found. Please check 'test:' section of the configuration file.
Empty test suite.

What version of the product are you using? On what operating system?
- JsTestDriver-1.3.5-patched.jar provided by Webstorm 6.0.1
- Windows 7 HomePremium 64bit

Please provide any additional information below.

As soon as you give the module a name the test works:

---- src/Crap.js ------------
define("Crap", function() {
    return function() {
        return "Hello World";
    }
});
-----------------------------

Wrong this in it()


describe('bug', function(){
  it('should spy on function', function(){
    var fn = jasmine.createSpy();
    this.spyOn(fn).andReturn(123); // <- this fails as this.spyOn is undefined
  });
});

Jasmine Adapter clean equality testers added in global scope

Jasmine have ability to add custom equality testers. However when these testers added in global scope (e.g not during actual test run) using following syntax:

jasmine.getEnv().addEqualityTester(MyEqualityTester);

they will be cleaned by jasmine adapter. Reason is that adapter recreate environment before all test are executed in the JSTD register function:

jstestdriver.pluginRegistrar.register({

name: 'jasmine',

runTestConfiguration: function(config, onTestDone, onComplete){
    if (config.getTestCaseInfo().getType() != JASMINE_TYPE) return false;
    (jasmine.currentEnv_ = new Env(onTestDone, onComplete)).execute();
    return true;
},

onTestsFinish: function(){
    jasmine.currentEnv_ = null;
    collectMode = true;
}

});

line:

(jasmine.currentEnv_ = new Env(onTestDone, onComplete)).execute();

In order to fix this adapter should extend already instantiated environment instead of creating new.

Work in describe is not executed properly

here is the bug


describe('bug', function(){
  var state = 'initial';

  it('should have state initial', function(){
    expect(state).toEqual('initial');
    state = 'asserted';
  });

  it('should have state reset to initial', function(){
    expect(state).toEqual('initial'); // this FAILS
    state = 'asserted';
  });
});

[enhancement] Add missing bower.json.

Hey, maintainer(s) of ibolmo/jasmine-jstd-adapter!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library ibolmo/jasmine-jstd-adapter is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "ibolmo/jasmine-jstd-adapter",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

frame.before is undefined error

It appears that the variable 'frame' in the function 'frame(parent, name)' was inlined. The problem with that is that the variable 'frame' is used inside a function in its definition, leading to this error. Introducing the variable 'frame' and returning it fixes the issue.

specs duplicated when modifying any loaded JS file

I'm running jsTestDriver with Jasmine and this adapter. Every time I update any of the JS files in the config file, specs appear to be duplicated and appended to the existing test suite.

e.g. this first run:

......
Total 6 tests (Passed: 6; Fails: 0; Errors: 0) (3.00 ms)
  Firefox 4.0 Windows: Run 6 tests (Passed: 6; Fails: 0; Errors 0) (3.00 ms)

can easily turn into this, by simply adding spaces and saving any JS file...

..............................................
Total 46 tests (Passed: 46; Fails: 0; Errors: 0) (3.00 ms)
  Firefox 4.0 Windows: Run 46 tests (Passed: 46; Fails: 0; Errors 0) (3.00 ms)

Jasmine latest versions e.g 2.x not supported.

Hi,

I appreciate your efforts to write this adapter, while this is brilliant for jasmine's older version e.g. 1.x it fails for latest version of jasmine.

I checked, that you moved to karma, still asking for help in this case. If possible, please update this for latest versions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.