Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
_ReSharper.*
bin
obj
packages
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Noesis.Javascript.Headless"]
path = Noesis.Javascript.Headless
url = git@github.com:leviwilson/Noesis.Javascript.Headless.git
38 changes: 38 additions & 0 deletions HeadlessTestingDemo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Linq;
using NUnit.Framework;
using Noesis.Javascript.Headless;
using Noesis.Javascript.Headless.Reporters;

namespace HeadlessTestingDemo
{
[TestFixture]
public class HeadlessTestingDemo
{
[Test, TestCaseSource("JasmineResults")]
public void Expect(string testName, string errors)
{
Assert.That(errors, Is.Null);
}

public object [] JasmineResults
{
get
{
var testRunner = new JavaScriptTestRunner();
testRunner.Include(JavaScriptLibrary.jQuery_1_6_4_min);
testRunner.Include(JavaScriptLibrary.Jasmine_1_1_0);

// load the "Roman.js" file from the resource specified in <T>, which happens to be this assembly but could be in another project.
testRunner.LoadFromResource<HeadlessTestingDemo>("Roman.js");
testRunner.LoadFromResource<HeadlessTestingDemo>("RomanSpec.js");
testRunner.LoadFromResource<HeadlessTestingDemo>("SpecHelper.js");

var testReporter = new ResultsReporter();
testRunner.RunJasmineSpecs(testReporter);
return testReporter.Results
.Select(x => new[] {x.Key, x.Value})
.ToArray();
}
}
}
}
37 changes: 25 additions & 12 deletions HeadlessTestingDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9024A0AE-E5B7-47E8-8673-66E26CBB022B}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HeadlessTestingDemo</RootNamespace>
<AssemblyName>HeadlessTestingDemo</AssemblyName>
Expand All @@ -33,28 +33,41 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Noesis.Javascript">
<HintPath>Vendor\Noesis.Javascript.dll</HintPath>
<Reference Include="nunit.framework">
<HintPath>packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunit.mocks">
<HintPath>packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
</Reference>
<Reference Include="pnunit.framework">
<HintPath>packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Content Include="README.txt" />
<Compile Include="TestRunner.cs" />
<Compile Include="HeadlessTestingDemo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Jasmine\env.therubyracer.js" />
<Content Include="Jasmine\jasmine.js" />
<Content Include="Jasmine\window.js" />
<Content Include="Scripts\jquery-1.4.2.js" />
<Content Include="Scripts\Roman.js" />
<Content Include="Specs\RomanSpec.js" />
<Content Include="Specs\SpecHelper.js" />
<ProjectReference Include="..\Noesis.Javascript.Headless\Noesis.Javascript.Headless.csproj">
<Project>{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}</Project>
<Name>Noesis.Javascript.Headless</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Scripts\Roman.js" />
<EmbeddedResource Include="Specs\RomanSpec.js" />
<EmbeddedResource Include="Specs\SpecHelper.js" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
14 changes: 14 additions & 0 deletions HeadlessTestingDemo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeadlessTestingDemo", "HeadlessTestingDemo.csproj", "{9024A0AE-E5B7-47E8-8673-66E26CBB022B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Noesis.Javascript.Headless", "..\Noesis.Javascript.Headless\Noesis.Javascript.Headless.csproj", "{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9024A0AE-E5B7-47E8-8673-66E26CBB022B}.Debug|Any CPU.ActiveCfg = Debug|x86
{9024A0AE-E5B7-47E8-8673-66E26CBB022B}.Debug|x86.ActiveCfg = Debug|x86
{9024A0AE-E5B7-47E8-8673-66E26CBB022B}.Debug|x86.Build.0 = Debug|x86
{9024A0AE-E5B7-47E8-8673-66E26CBB022B}.Release|Any CPU.ActiveCfg = Release|x86
{9024A0AE-E5B7-47E8-8673-66E26CBB022B}.Release|x86.ActiveCfg = Release|x86
{9024A0AE-E5B7-47E8-8673-66E26CBB022B}.Release|x86.Build.0 = Release|x86
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Debug|x86.ActiveCfg = Debug|x86
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Debug|x86.Build.0 = Debug|x86
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Release|Any CPU.Build.0 = Release|Any CPU
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Release|x86.ActiveCfg = Release|x86
{8907A3D2-FEDC-40AA-9788-15DAC0A0D2A7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading