knutkj / pstest Goto Github PK
View Code? Open in Web Editor NEWPsTest is a PowerShell unit testing framework.
Home Page: https://github.com/knutkj/pstest/wiki
PsTest is a PowerShell unit testing framework.
Home Page: https://github.com/knutkj/pstest/wiki
I want to be able to do NUnit like test case testing with PsTest. Example:
New-Test -Name 'Test case test' -TestCase 1, 2 -TestScript {
# This script block will be executed two times. Once for
# each item in test case array.
param ($testCaseItem) # Will be 1 and 2.
# Do testing based on test cases.
# That means test code will be invoked two times.
# Once for each test case.
}
In JavaScript this would look like:
test('Test case test', [ 1, 2 ], function (testCaseItem) {
// This anonymous function will be executed two times. Once for
// each item in test case array.
});
When I saw this I thought: "what a great way of doing this" but MS went and changd things with v3. The output and interactive panes were replaced by the single console-like pane and now, with your sample test script, with the .\script-to-test.ps1 commented-out, we just get:
Expected exception
NUnit assert test
Passed tests: 1/2.
Any chance you might update this for v3?
Add error record property to test result. Would look something like this:
public System.Management.Automation.ErrorRecord ErrorRecord
{
get { return _errorRecord; }
}
Implement expected exception message. Would loke like this:
New-Test 'Test1' -ExpectedException [Exception] -ExpectedMessage 'msg' {
# Will pass test:
throw (New-Object -TypeName Exception -ArgumentList 'msg')
# Will not pass test:
throw (New-Object -TypeName Exception -ArgumentList 'invalid msg')
}
Copy assembly to temporary location. Import the copy of the assembly into the NuGet PowerShell host.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.