-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding feature test for additional contexts
- Loading branch information
Showing
7 changed files
with
87 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Feature: Additional contexts can be configured. | ||
|
||
In order to reference javascript files outside of the standard source and spec directories | ||
I want to be able to configure additional contexts | ||
|
||
Scenario: Reference a vendor script outside of the source directory | ||
|
||
Given I am currently in the "jasmine-webapp-additional-contexts" project | ||
When I run "mvn clean install" | ||
Then the build should succeed | ||
And I should see "Results: 1 specs, 0 failures" | ||
|
||
@server | ||
Scenario: Reference a vendor script outside of the source directory in browser | ||
|
||
Given I am currently in the "jasmine-webapp-additional-contexts" project | ||
When I run "mvn clean jasmine:bdd" in a new process | ||
And I load "http://localhost:8234" in a browser | ||
Then the page should contain "Passing 1 spec" |
40 changes: 40 additions & 0 deletions
40
src/test/resources/examples/jasmine-webapp-additional-contexts/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.github.searls</groupId> | ||
<artifactId>jasmine-example-superpom</artifactId> | ||
<version>%{project.version}</version> | ||
</parent> | ||
<artifactId>jasmine-webapp-passing</artifactId> | ||
<packaging>war</packaging> | ||
<name>Example Webapp using Jasmine Maven Plugin</name> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.github.searls</groupId> | ||
<artifactId>jasmine-maven-plugin</artifactId> | ||
<version>%{project.version}</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<additionalContexts> | ||
<context> | ||
<contextRoot>vendor</contextRoot> | ||
<directory>src/main/vendor</directory> | ||
</context> | ||
</additionalContexts> | ||
<preloadSources> | ||
<source>vendor/math.js</source> | ||
</preloadSources> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
7 changes: 7 additions & 0 deletions
7
...t/resources/examples/jasmine-webapp-additional-contexts/src/main/javascript/sample-app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(function(window) { | ||
window.app = { | ||
calculate : function() { | ||
return math.add(15,35); | ||
} | ||
}; | ||
})(this); |
7 changes: 7 additions & 0 deletions
7
src/test/resources/examples/jasmine-webapp-additional-contexts/src/main/vendor/math.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(function(window) { | ||
window.math = { | ||
add : function(a,b) { | ||
return a+b; | ||
} | ||
}; | ||
})(this); |
7 changes: 7 additions & 0 deletions
7
...ources/examples/jasmine-webapp-additional-contexts/src/test/javascript/sample-app-spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
describe('app',function(){ | ||
|
||
it('should calculate to 50',function(){ | ||
expect(app.calculate()).toBe(50); | ||
}); | ||
|
||
}); |