Skip to content

Commit 32c8eda

Browse files
author
Kelly Selden
authored
Merge pull request #69 from kellyselden/output-text
assert output text
2 parents c1cb782 + c2cd951 commit 32c8eda

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

__tests__/bin-test.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,32 @@ describe('bin acceptance', function() {
102102
});
103103

104104
it('works', function() {
105-
cp.spawnSync('node', [
106-
path.join(process.cwd(), 'bin/ember-modules-codemod')
107-
], {
108-
cwd: tmpPath,
109-
stdio: 'inherit'
110-
});
105+
let stdout = '';
106+
let exitCode;
107+
108+
return new Promise(resolve => {
109+
let ps = cp.spawn('node', [
110+
path.join(process.cwd(), 'bin/ember-modules-codemod')
111+
], {
112+
cwd: tmpPath
113+
});
114+
115+
ps.stdout.on('data', data => {
116+
stdout += data.toString();
117+
});
111118

112-
expect(fs.readFileSync(tmpFile, 'utf8')).toEqual(fs.readFileSync(outputFile, 'utf8'));
119+
ps.on('exit', (code, signal) => {
120+
exitCode = code;
121+
122+
resolve();
123+
});
124+
}).then(() => {
125+
expect(exitCode).toEqual(0);
126+
127+
expect(stdout).toMatch('Done! All uses of the Ember global have been updated.\n');
128+
129+
expect(fs.readFileSync(tmpFile, 'utf8')).toEqual(fs.readFileSync(outputFile, 'utf8'));
130+
});
113131
});
114132
});
115133
});

0 commit comments

Comments
 (0)