@@ -79,14 +79,18 @@ function writeToFile(fileName,data,space=2){
7979import { promisify } from 'node:util' ;
8080import { spawn , spawnSync } from 'node:child_process' ;
8181import { spawnExecCmd } from "##/dev/node-fs-utils-dev/SpawnCmd.mjs" ;
82+ import { cwd } from 'node:process' ;
83+ function assertEcho ( actual , expected ) {
84+ assert . strictEqual ( actual . replace ( / \r / g, '' ) , expected ) ;
8285
86+ }
8387describe ( 'SpawnCmd.test.mjs' , function ( ) {
8488 it ( 'spawnExecCmd' , async function ( ) {
8589 this . timeout ( 5000 ) ;
8690 let out ;
8791 out = await spawnExecCmd ( 'echo hi' , [ ] , { shell :true } ) ;
8892 // console.log(out);
89- assert . strictEqual ( out . stdout , 'hi\n' ) ;
93+ assertEcho ( out . stdout , 'hi\n' ) ;
9094 } ) ;
9195 it ( 'spawnSync' , async function ( ) {
9296 this . timeout ( 5000 ) ;
@@ -100,10 +104,17 @@ describe('SpawnCmd.test.mjs', function(){
100104 // console.log(out);
101105 //UintArrasy
102106 // const tmp = new Uint8Array(stdout);
103- assert . strictEqual ( hello , 'hi\n' ) ;
107+ assertEcho ( hello , 'hi\n' ) ;
104108 } ) ;
109+
105110} ) ;
111+ /**
112+ * look at
113+ * spawnCmd-cwd.test.mjs
114+ * for device specific
115+ */
106116
117+ //
107118describe ( 'SpawnCmd.test.mjs experiments' , function ( ) {
108119 /**
109120 * doesnt work
@@ -116,3 +127,7 @@ describe('SpawnCmd.test.mjs experiments', function(){
116127 console . log ( out ) ;
117128 } ) ;
118129} ) ;
130+
131+ /**
132+ * env seems to be done in vite-press-docs.git
133+ */
0 commit comments