@@ -2,9 +2,9 @@ import { createStubExec } from "../adapters/exec.stubs";
22import { findPackagesConfiguration } from "./findPackagesConfiguration" ;
33
44describe ( "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 ( ) => {
66 // Arrange
7- const dependencies = { exec : createStubExec ( ) } ;
7+ const dependencies = { exec : createStubExec ( ) , platform : "darwin" } ;
88
99 // Act
1010 await findPackagesConfiguration ( dependencies , undefined ) ;
@@ -13,9 +13,20 @@ describe("findPackagesConfiguration", () => {
1313 expect ( dependencies . exec ) . toHaveBeenLastCalledWith ( `cat "./package.json"` ) ;
1414 } ) ;
1515
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+
1627 it ( "includes a configuration file in the packages command when one is provided" , async ( ) => {
1728 // Arrange
18- const dependencies = { exec : createStubExec ( ) } ;
29+ const dependencies = { exec : createStubExec ( ) , platform : "darwin" } ;
1930 const config = "./custom/package.json" ;
2031
2132 // Act
@@ -27,7 +38,7 @@ describe("findPackagesConfiguration", () => {
2738
2839 it ( "applies packages defaults when none are provided" , async ( ) => {
2940 // Arrange
30- const dependencies = { exec : createStubExec ( { stdout : "{}" } ) } ;
41+ const dependencies = { exec : createStubExec ( { stdout : "{}" } ) , platform : "darwin" } ;
3142 const config = "./package.json" ;
3243
3344 // Act
0 commit comments