New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fable and Mocha #1

Open
wants to merge 1 commit into
base: master
from
Jump to file or symbol
Failed to load files and symbols.
+155 −0
Diff settings

Always

Just for now

Copy path View file
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-fable" Version="2.0.9" />
</ItemGroup>
</Project>
Copy path View file

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Copy path View file
@@ -8,5 +8,8 @@
"webpack-dev-server": "^3.1.10",
"react": "^16.6.0",
"react-dom": "^16.6.0"
},
"devDependencies": {
"mocha": "^5.2.0"
}
}
Copy path View file
@@ -0,0 +1,10 @@
module Test.Main

open Test.Util

let run () =
describe "tests" <| fun () ->
it "asserts something" <| fun () ->
assertEqual 1 1

run ()
Copy path View file
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../src/App.fsproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="Util.fs" />
<Compile Include="Main.fs" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-fable" Version="2.0.9" />
</ItemGroup>
</Project>
Copy path View file
@@ -0,0 +1,10 @@
module Test.Util

open Fable.Core
open Fable.Core.Testing

let [<Global>] describe (name: string) (f: unit -> unit) = jsNative
let [<Global>] it (msg: string) (f: unit -> unit) = jsNative

let assertEqual expected actual: unit =
Assert.AreEqual(actual, expected)
Copy path View file
@@ -0,0 +1,20 @@
var path = require("path");
var webpack = require("webpack");

module.exports = {
mode: "development",
entry: "./test/Test.fsproj",
output: {
path: path.join(__dirname, "./test/bin"),
filename: "bundle.js",
},
module: {
rules: [{
test: /\.fs(x|proj)?$/,
use: "fable-loader"
}]
},
plugins: [
new webpack.NamedModulesPlugin()
]
}
ProTip! Use n and p to navigate between commits in a pull request.