Skip to content

Commit

Permalink
test: add a test checking that when packing a library we include the …
Browse files Browse the repository at this point in the history
…source files and project file
  • Loading branch information
MangelMaxime committed Jul 27, 2024
1 parent 810bf46 commit e757325
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,22 @@ let ``should support multiple fable targets`` () =
Is.EqualTo("fable-rust;fable-javascript;fable-python;fable;fable-library")
)
}

[<Test>]
let ``should include the source file and the project file under 'fable' folder`` () =
task {
let! stdout, _ =
Command.ReadAsync(
"dotnet",
$"msbuild %s{Workspace.fixtures.valid.``library-with-files``.``MyLibrary.fsproj``} --getItem:Content"
)

Assert.That(
stdout.Trim(),
Contains.Substring("tests/fixtures/valid/library-with-files/Entry.fs")
)
Assert.That(
stdout.Trim(),
Contains.Substring("tests/fixtures/valid/library-with-files/MyLibrary.fsproj")
)
}
3 changes: 3 additions & 0 deletions tests/fixtures/valid/library-with-files/Entry.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module MyLibrary

let answer = 42
11 changes: 11 additions & 0 deletions tests/fixtures/valid/library-with-files/MyLibrary.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<FablePackageType>library</FablePackageType>
</PropertyGroup>
<ItemGroup>
<Compile Include="Entry.fs" />
</ItemGroup>
<Import Project="./../../Fable.Package.SDK.Imports.props" />
</Project>

0 comments on commit e757325

Please sign in to comment.