Skip to content

Commit e757325

Browse files
committed
test: add a test checking that when packing a library we include the source files and project file
1 parent 810bf46 commit e757325

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

tests/Main.fs

+19
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,22 @@ let ``should support multiple fable targets`` () =
221221
Is.EqualTo("fable-rust;fable-javascript;fable-python;fable;fable-library")
222222
)
223223
}
224+
225+
[<Test>]
226+
let ``should include the source file and the project file under 'fable' folder`` () =
227+
task {
228+
let! stdout, _ =
229+
Command.ReadAsync(
230+
"dotnet",
231+
$"msbuild %s{Workspace.fixtures.valid.``library-with-files``.``MyLibrary.fsproj``} --getItem:Content"
232+
)
233+
234+
Assert.That(
235+
stdout.Trim(),
236+
Contains.Substring("tests/fixtures/valid/library-with-files/Entry.fs")
237+
)
238+
Assert.That(
239+
stdout.Trim(),
240+
Contains.Substring("tests/fixtures/valid/library-with-files/MyLibrary.fsproj")
241+
)
242+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module MyLibrary
2+
3+
let answer = 42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<FablePackageType>library</FablePackageType>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<Compile Include="Entry.fs" />
9+
</ItemGroup>
10+
<Import Project="./../../Fable.Package.SDK.Imports.props" />
11+
</Project>

0 commit comments

Comments
 (0)