File tree Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Expand file tree Collapse file tree 2 files changed +20
-14
lines changed Original file line number Diff line number Diff line change 1
1
process . env . FORCE_COLOR = '0'
2
- let mockedStdoutBuffer : string = ''
3
- const mockStdout = jest . spyOn ( process . stdout , 'write' ) . mockImplementation ( ( data ) => {
4
- mockedStdoutBuffer += data
5
- return true
6
- } )
7
-
8
- afterEach ( ( ) => {
9
- mockedStdoutBuffer = ''
10
- } )
11
-
12
- const mockExit = jest . spyOn ( process , 'exit' ) . mockImplementation ( ( ( n : any ) => {
13
- mockedStdoutBuffer += `\n\n--- process.exit(${ n } ) ---\n\n`
14
- } ) as any )
15
2
16
3
import { log } from '@nexus/logger'
17
4
import { defaultsDeep } from 'lodash'
@@ -24,6 +11,24 @@ import * as TC from '../test-context'
24
11
import { repalceInObject , replaceEvery } from '../utils'
25
12
import { NEXUS_TS_LSP_IMPORT_ID } from './tsconfig'
26
13
14
+ let mockedStdoutBuffer : string = ''
15
+
16
+ log . settings ( {
17
+ output : {
18
+ write ( data ) {
19
+ mockedStdoutBuffer += data
20
+ } ,
21
+ } ,
22
+ } )
23
+
24
+ afterEach ( ( ) => {
25
+ mockedStdoutBuffer = ''
26
+ } )
27
+
28
+ const mockExit = jest . spyOn ( process , 'exit' ) . mockImplementation ( ( ( n : any ) => {
29
+ mockedStdoutBuffer += `\n\n--- process.exit(${ n } ) ---\n\n`
30
+ } ) as any )
31
+
27
32
/**
28
33
* Disable logger timeDiff and color to allow snapshot matching
29
34
*/
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export function parse(contents: string, path: string) {
61
61
)
62
62
if ( isLeft ( errRawData ) ) return errRawData
63
63
const rawData = errRawData . right
64
- console . log ( rawData )
64
+
65
65
if ( ! isPlainObject ( rawData ) )
66
66
return left ( malformedPackageJson ( { path, reason : 'Package.json data is not an object' } ) )
67
67
if ( ! isString ( rawData . name ) )
@@ -72,5 +72,6 @@ export function parse(contents: string, path: string) {
72
72
return left ( malformedPackageJson ( { path, reason : 'Package.json version field is not a string' } ) )
73
73
if ( isEmpty ( rawData . version ) )
74
74
return left ( malformedPackageJson ( { path, reason : 'Package.json version field is empty' } ) )
75
+
75
76
return right ( rawData as ValidPackageJson )
76
77
}
You can’t perform that action at this time.
0 commit comments