We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6aab926 commit 0e93348Copy full SHA for 0e93348
1 file changed
Tests/Engine/InvokeFormatter.tests.ps1
@@ -0,0 +1,36 @@
1
+$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
2
+$testRootDirectory = Split-Path -Parent $directory
3
+
4
+Import-Module PSScriptAnalyzer
5
+Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")
6
7
+Describe "Invoke-Formatter Cmdlet" {
8
+ Context "When no settings are given" {
9
+ It "Should format using default settings" {
10
+ $def = @'
11
+function foo
12
+{
13
+get-childitem
14
+$x=1+2
15
+$hashtable = @{
16
+property1 = "value"
17
+ anotherProperty = "another value"
18
+}
19
20
+'@
21
+ $expected = @'
22
+function foo {
23
+ get-childitem
24
+ $x = 1 + 2
25
+ $hashtable = @{
26
+ property1 = "value"
27
28
+ }
29
30
31
32
+ Invoke-Formatter -ScriptDefinition $def | Should Be $expected
33
34
35
36
0 commit comments