Skip to content

Bridge for continuous testing / build server testing of JavaScript tests

License

Notifications You must be signed in to change notification settings

matt-mercer/ghost-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghost-bridge

What is it ?

Ghost-Bridge is a bridge for continuous testing / build server testing of JavaScript tests, it allows you to run your javascript tests from visual studio test tools like Resharper and NCrunch, and also on your build server with no extra effort.

How does it work?

Ghost-Bridge uses a custom MS-Build target to ILGen a code stub hook for MSpec or NUnit that encapsulates the Chutzpah Test Runner, ( Chutzpah uses PhantomJs.exe and supports QUnit and Jasmine Javascript tests )

.Net Versions

At the moment it only supports .Net 4.5, this is because I wanted it to be dependency free, (apart from the test frameworks themselves), to make it portable for NCrunch .. I didn't get round to implementing the zip inflate algorithm for .net 4.0, oh and Chutzpah is only .net 4.0 in recent versions

Installation

install-package GhostBridge.Mspec or install-package GhostBridge.NUnit

Remember this only works with projects with target framework >= .net 4.5 !

the nuget install should add the following to the project file <Import Project="GhostBridge.msbuild.targets" />

the msbuild target should look something like this

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	<UsingTask TaskName="GhostBridge.MSpec.MSBuildTask" AssemblyFile="../packages/GhostBridge.MSpec.1.1.0.0/lib/net45/GhostBridge.MSpec.dll" />
	<Target Name="GhostBridge" AfterTargets="AfterResolveReferences">
		<Message Text="Generating tests" Importance="High" />
		<MSBuildTask BaseDirectory="$(ProjectDir)" Pattern="*.*" Language="$(Language)" ProjectDir="$(ProjectDir)">
			<Output TaskParameter="SpecCount" ItemName="SpecCount" />
		</MSBuildTask>
		<Message Text="Found :: @(SpecCount) specs" Importance="High" />
		<ItemGroup Condition="@(SpecCount)!='0'">
			<Compile Include="ghost_bridge_specs.cs" />
		</ItemGroup>
		<Message Text="Complete" Importance="High" />
	</Target>
</Project>

things to note here:

BaseDirectory="$(ProjectDir)" change this to restrict where the test generator looks for your specs .. eg BaseDirectory="$(ProjectDir)\jasmin-specs"

Pattern="*.*" change this to filter the files ... eg Pattern="*.jasmin.spec.js

AssemblyFile="../packages/GhostBridge.MSpec.1.1.0.0/lib/net45/GhostBridge.MSpec.dll" /> this path will need to be available at build time to your test runner , this is particularly relevant for NCrunch ( look at 'additional files to include' for your project under ncrunch settings )

About

Bridge for continuous testing / build server testing of JavaScript tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published