File tree Expand file tree Collapse file tree 19 files changed +91
-229
lines changed Expand file tree Collapse file tree 19 files changed +91
-229
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Bun development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Bun development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Deno development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Deno development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in esbuild development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ esbuild development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Next.js development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Next.js development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Node.js explicit development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Node.js explicit development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Node.js implicit development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Node.js development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Rollup development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Rollup development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in SWC development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ SWC development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Vite development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Vite development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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' ;
@@ -10,17 +10,11 @@ class FakeGraphQLObjectType {
10
10
const fakeInstance = new FakeGraphQLObjectType ( ) ;
11
11
12
12
try {
13
- const result = isObjectType ( fakeInstance ) ;
14
-
15
- // In development mode, this should throw an error about multiple GraphQL modules
16
- // If we get here without an error, development mode is not working
17
- console . error ( '✗ Development mode test failed - expected error was not thrown' ) ;
18
- process . exit ( 1 ) ;
13
+ isObjectType ( fakeInstance ) ;
14
+ assert . fail ( 'Expected isObjectType to throw an error in Webpack development mode.' ) ;
19
15
} catch ( error ) {
20
- if ( error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ) {
21
- console . log ( '✓ Webpack development mode integration test passed' ) ;
22
- } else {
23
- console . error ( '✗ Development mode test failed - unexpected error:' , error . message ) ;
24
- process . exit ( 1 ) ;
25
- }
16
+ assert . ok (
17
+ error . message . includes ( 'multiple' ) || error . message . includes ( 'GraphQL' ) ,
18
+ `Expected error message to include 'multiple' or 'GraphQL', but got: "${ error . message } "`
19
+ ) ;
26
20
}
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 ( '✓ Bun 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 , 'isObjectType should return false in Bun production mode.' ) ;
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 ( '✓ Deno 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 , 'isObjectType should return false in Deno production mode.' ) ;
You can’t perform that action at this time.
0 commit comments