Skip to content

Commit 4da5e9b

Browse files
committed
refactor: remove console.log and simplify prod integration tests
1 parent e4c328a commit 4da5e9b

File tree

3 files changed

+9
-48
lines changed

3 files changed

+9
-48
lines changed
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1+
import assert from 'assert';
12
import { isObjectType } from 'graphql';
23

3-
// Create a fake GraphQLObjectType to test instanceof behavior
44
class FakeGraphQLObjectType {
55
constructor() {
66
this.name = 'Fake';
77
}
88
}
99

1010
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);
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1+
import assert from 'assert';
12
import { isObjectType } from 'graphql';
23

3-
// Create a fake GraphQLObjectType to test instanceof behavior
44
class FakeGraphQLObjectType {
55
constructor() {
66
this.name = 'Fake';
77
}
88
}
99

1010
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);
Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1+
import assert from 'assert';
12
import { isObjectType } from 'graphql';
23

3-
// Create a fake GraphQLObjectType to test instanceof behavior
44
class FakeGraphQLObjectType {
55
constructor() {
66
this.name = 'Fake';
77
}
88
}
99

1010
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);

0 commit comments

Comments
 (0)