File tree Expand file tree Collapse file tree 3 files changed +9
-48
lines changed Expand file tree Collapse file tree 3 files changed +9
-48
lines changed Original file line number Diff line number Diff line change
1
+ import assert from 'assert' ;
1
2
import { isObjectType } from 'graphql' ;
2
3
3
- // Create a fake GraphQLObjectType to test instanceof behavior
4
4
class FakeGraphQLObjectType {
5
5
constructor ( ) {
6
6
this . name = 'Fake' ;
7
7
}
8
8
}
9
9
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
-
12
- try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In production mode, this should return false without throwing
16
- if ( result === false ) {
17
- console . log ( '✓ SWC production mode integration test passed' ) ;
18
- } else {
19
- console . error ( '✗ Production mode test failed - expected false, got:' , result ) ;
20
- process . exit ( 1 ) ;
21
- }
22
- } catch ( error ) {
23
- console . error ( '✗ Production mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
11
+ const result = isObjectType ( fakeInstance ) ;
12
+ assert . strictEqual ( result , false ) ;
Original file line number Diff line number Diff line change
1
+ import assert from 'assert' ;
1
2
import { isObjectType } from 'graphql' ;
2
3
3
- // Create a fake GraphQLObjectType to test instanceof behavior
4
4
class FakeGraphQLObjectType {
5
5
constructor ( ) {
6
6
this . name = 'Fake' ;
7
7
}
8
8
}
9
9
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
-
12
- try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In production mode, this should return false without throwing
16
- if ( result === false ) {
17
- console . log ( '✓ Vite production mode integration test passed' ) ;
18
- } else {
19
- console . error ( '✗ Production mode test failed - expected false, got:' , result ) ;
20
- process . exit ( 1 ) ;
21
- }
22
- } catch ( error ) {
23
- console . error ( '✗ Production mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
11
+ const result = isObjectType ( fakeInstance ) ;
12
+ assert . strictEqual ( result , false ) ;
Original file line number Diff line number Diff line change
1
+ import assert from 'assert' ;
1
2
import { isObjectType } from 'graphql' ;
2
3
3
- // Create a fake GraphQLObjectType to test instanceof behavior
4
4
class FakeGraphQLObjectType {
5
5
constructor ( ) {
6
6
this . name = 'Fake' ;
7
7
}
8
8
}
9
9
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
-
12
- try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In production mode, this should return false without throwing
16
- if ( result === false ) {
17
- console . log ( '✓ Webpack production mode integration test passed' ) ;
18
- } else {
19
- console . error ( '✗ Production mode test failed - expected false, got:' , result ) ;
20
- process . exit ( 1 ) ;
21
- }
22
- } catch ( error ) {
23
- console . error ( '✗ Production mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
11
+ const result = isObjectType ( fakeInstance ) ;
12
+ assert . strictEqual ( result , false ) ;
You can’t perform that action at this time.
0 commit comments