Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
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
25 changes: 25 additions & 0 deletions build/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,35 @@ function Test-Python {
}
}

function Test-JavaScript {
Param([string] $packageFolder, [string] $options)

Write-Host "##[info]Installing JS packages from $packageFolder"
Push-Location (Join-Path $PSScriptRoot $packageFolder)
npm install
Pop-Location

Write-Host "##[info]Testing JS inside $packageFolder"
Push-Location (Join-Path $PSScriptRoot $packageFolder)
if (!$options) {
npm test
} else {
npm test -- $options
}
Pop-Location

if ($LastExitCode -ne 0) {
Write-Host "##vso[task.logissue type=error;]Failed to test JS inside $packageFolder"
$script:all_ok = $False
}
}

Test-One '../iqsharp.sln'

Test-Python '../src/Python' '../src/Python/qsharp/tests'

Test-JavaScript '../src/Kernel'

if (-not $all_ok)
{
throw "At least one project failed to compile. Check the logs."
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Testing _qubitInput classical register 1`] = `"<text x=\\"20\\" y=\\"20\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"`;

exports[`Testing _qubitInput classical register 2`] = `"<text x=\\"20\\" y=\\"50\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"`;

exports[`Testing _qubitInput classical register 3`] = `"<text x=\\"20\\" y=\\"0\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"`;

exports[`Testing formatInputs 1 quantum register 1`] = `"<text x=\\"20\\" y=\\"40\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"`;

exports[`Testing formatInputs Multiple quantum registers 1`] = `
"<text x=\\"20\\" y=\\"40\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"100\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"160\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"
`;

exports[`Testing formatInputs Quantum and classical registers 1`] = `
"<text x=\\"20\\" y=\\"40\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"120\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"180\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"
`;

exports[`Testing formatInputs Quantum and classical registers 2`] = `
"<text x=\\"20\\" y=\\"40\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"100\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"220\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"
`;

exports[`Testing formatInputs Skip quantum registers 1`] = `
"<text x=\\"20\\" y=\\"40\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>
<text x=\\"20\\" y=\\"100\\" dominant-baseline=\\"middle\\" text-anchor=\\"start\\">|0⟩</text>"
`;

Large diffs are not rendered by default.

Loading