@@ -2,9 +2,9 @@ import { createStubExec } from "../adapters/exec.stubs";
2
2
import { findPackagesConfiguration } from "./findPackagesConfiguration" ;
3
3
4
4
describe ( "findPackagesConfiguration" , ( ) => {
5
- it ( "defaults the configuration file when one isn't provided" , async ( ) => {
5
+ it ( "defaults the configuration file with cat when one isn't provided on a non-Windows platform " , async ( ) => {
6
6
// Arrange
7
- const dependencies = { exec : createStubExec ( ) } ;
7
+ const dependencies = { exec : createStubExec ( ) , platform : "darwin" } ;
8
8
9
9
// Act
10
10
await findPackagesConfiguration ( dependencies , undefined ) ;
@@ -13,9 +13,20 @@ describe("findPackagesConfiguration", () => {
13
13
expect ( dependencies . exec ) . toHaveBeenLastCalledWith ( `cat "./package.json"` ) ;
14
14
} ) ;
15
15
16
+ it ( "defaults the configuration file with type when one isn't provided on a Windows platform" , async ( ) => {
17
+ // Arrange
18
+ const dependencies = { exec : createStubExec ( ) , platform : "win32" } ;
19
+
20
+ // Act
21
+ await findPackagesConfiguration ( dependencies , undefined ) ;
22
+
23
+ // Assert
24
+ expect ( dependencies . exec ) . toHaveBeenLastCalledWith ( `type "./package.json"` ) ;
25
+ } ) ;
26
+
16
27
it ( "includes a configuration file in the packages command when one is provided" , async ( ) => {
17
28
// Arrange
18
- const dependencies = { exec : createStubExec ( ) } ;
29
+ const dependencies = { exec : createStubExec ( ) , platform : "darwin" } ;
19
30
const config = "./custom/package.json" ;
20
31
21
32
// Act
@@ -27,7 +38,7 @@ describe("findPackagesConfiguration", () => {
27
38
28
39
it ( "applies packages defaults when none are provided" , async ( ) => {
29
40
// Arrange
30
- const dependencies = { exec : createStubExec ( { stdout : "{}" } ) } ;
41
+ const dependencies = { exec : createStubExec ( { stdout : "{}" } ) , platform : "darwin" } ;
31
42
const config = "./package.json" ;
32
43
33
44
// Act
0 commit comments