Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

saga does not generate correct report for jasmine test cases #137

Open
punyaniricha opened this issue Mar 28, 2018 · 0 comments
Open

saga does not generate correct report for jasmine test cases #137

punyaniricha opened this issue Mar 28, 2018 · 0 comments

Comments

@punyaniricha
Copy link

Hi,

I have done below configuration in pom.xml for jasmine and saga but I am not getting the correct coverage report.

                   <plugin>
			<groupId>com.github.searls</groupId>
			<artifactId>jasmine-maven-plugin</artifactId>
			<version>2.2</version>
			<executions>
				<execution>
					<goals>
						<goal>test</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<skipTests>false</skipTests>
				<keepServerAlive>true</keepServerAlive>
				<phantomjs>
					<version>2.1.1</version>
					<checkSystemPath>true</checkSystemPath>
					<enforceVersion>true</enforceVersion>
					<source>REPOSITORY</source>
					<baseUrl />
					<outputDirectory>target/phantomjs</outputDirectory>
				</phantomjs>
				<preloadSources>
					<source>test/lib/jasmine-2.3.4/jasmine.js</source>
					<source>test/lib/jasmine-2.3.4/jasmine-html.js</source>
					<source>test/lib/jasmine-2.3.4/boot.js</source>
					<source>test/lib/angular/angular.js</source>
					<source>test/lib/angular-mocks.js</source>
					<source>test/lib/**/*.js</source>
				</preloadSources>
				<jsSrcDir>${basedir}/src/main/webapp/app/</jsSrcDir>
				<sourceIncludes>
					<include>app.module.js</include>
					<include>**/*.module.js</include>
					<include>**/*.js</include>
				</sourceIncludes>

				<jsTestSrcDir>${basedir}/src/main/webapp/app/test/spec/</jsTestSrcDir>
				<specIncludes>
					<include>**/*.js</include>
				</specIncludes>					<customRunnerTemplate>src/main/webapp/app/SpecRunner.html</customRunnerTemplate>
				<format>progress</format>
			</configuration>
		</plugin>
		<plugin>
			<groupId>com.github.timurstrekalov</groupId>
			<artifactId>saga-maven-plugin</artifactId>
			<version>1.5.5</version>
			<executions>
                <execution>
                    <phase>test</phase>
                    <goals>
                        <goal>coverage</goal>
                    </goals>
                </execution>
            </executions>
			<configuration>
   				<baseDir>http://localhost:${jasmine.serverPort}</baseDir>
   				<noInstrumentPatterns>
        			<pattern>.*/spec/.*</pattern>
        			<pattern>.*\/lib\/.*\.js</pattern>
    			</noInstrumentPatterns>
   				<outputStrategy>BOTH</outputStrategy>
   				<sortBy>file</sortBy>
    			<outputDir>target/js-coverage-reports/</outputDir>
			</configuration>
		</plugin>

When I see my total-report.html file it shows only first few lines as covered where I have declared the controller and injected my dependencies.
(function() {
angular.module('manageDocuments').controller('manageDocumentsController',
manageDocumentsController);

manageDocumentsController.$inject = [ '$state', .....];

function manageDocumentsController($state, .....) {
	var mdc = this;

After the above function definition starts, there is no coverage statistics available thought my test cases are successful.
Please let me know if I am missing something.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant