Search code examples
javascriptjasminejasmine-maven-plugin

How to see results of all test specs in browser with jasmine maven plugin


I'm using the jasmine maven plugin and my pom.xml looks like this:

        <plugin>
            <groupId>com.github.searls</groupId>
            <artifactId>jasmine-maven-plugin</artifactId>
            <version>1.2.0.0</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                <goals>
                    <goal>test</goal>
                </goals>
                </execution>
            </executions>
            <configuration>
                <preloadSources>
                    <source>${project.basedir}/src/main/webapp/resources/js/jquery.js</source>
                    <source>${project.basedir}/src/main/webapp/resources/js/angular.js</source>
                    <source>${project.basedir}/src/test/javascript/lib/angular-mocks.js</source>
                    <source>${project.basedir}/src/test/javascript/lib/jasmine-fixture.js</source>
                </preloadSources>
                <jsSrcDir>${project.basedir}/src/main/webapp/resources/js/</jsSrcDir>
                <jsTestSrcDir>${project.basedir}/src/test/javascript/unit/</jsTestSrcDir>
            </configuration>
        </plugin>

in that unit directory, I have multiple js files that hold all the tests I want to run. When I run mvn jasmine:bdd and then go to localhost:8234 in my browser, it is only running the tests from the first file in the directory. When I run mvn jasmine:test it runs all my specs. I just want to know how I can get the results of all my specs in the browser window. I hope I'm just missing something obvious here.


Solution

  • My apologies, I failed to notice an error in console. My 2nd spec was erroring out, and thus not showing. Not sure why it passed when I ran it command line, but my problem is now solved.