JinPhil / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

testing modules without names should be supported #428

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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";
        }
    });
    -----------------------------

Original issue reported on code.google.com by toralion.starsheet on 29 Mar 2013 at 8:40

GoogleCodeExporter commented 8 years ago
Please file this request over here: 
https://github.com/ibolmo/jasmine-jstd-adapter

Original comment by corbinrs...@gmail.com on 29 Mar 2013 at 8:20