File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const CONSOLE = Object . assign ( { } , console ) ;
4+
5+ let consoleOutput ;
6+
7+ function setupConsole ( ) {
8+ consoleOutput = [ ] ;
9+
10+ console . info = function ( ) {
11+ consoleOutput . push ( ...arguments ) ;
12+ } ;
13+ }
14+
15+ function resetConsole ( ) {
16+ Object . assign ( console , CONSOLE ) ;
17+ consoleOutput = undefined ;
18+ }
19+
20+ function getConsoleOutput ( ) {
21+ return consoleOutput ;
22+ }
23+
24+ module . exports = {
25+ setupConsole,
26+ getConsoleOutput,
27+ resetConsole,
28+ } ;
Original file line number Diff line number Diff line change @@ -3,17 +3,20 @@ const fixturify = require('fixturify');
33const fse = require ( 'fs-extra' ) ;
44const path = require ( 'path' ) ;
55const Migrator = require ( '../../../lib/migrator' ) ;
6+ const { setupConsole, resetConsole } = require ( '../../helpers' ) ;
67
78assertDiff . options . strict = true ;
89
910describe ( 'structure = flat' , function ( ) {
1011 beforeEach ( function ( ) {
1112 this . tmpPath = 'tmp/process-files' ;
1213 fse . mkdirsSync ( this . tmpPath ) ;
14+ setupConsole ( ) ;
1315 } ) ;
1416
1517 afterEach ( function ( ) {
1618 fse . removeSync ( this . tmpPath ) ;
19+ resetConsole ( ) ;
1720 } ) ;
1821
1922 describe ( 'For an app with component classes written in JavaScript' , function ( ) {
You can’t perform that action at this time.
0 commit comments