Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ rules:
capitalized-comments: off # maybe
consistent-this: off
func-name-matching: off
func-names: off
func-names: [error, as-needed] # improve debug experience
func-style: off
id-denylist: off
id-length: off
Expand Down
2 changes: 1 addition & 1 deletion resources/eslint-internal-rules/no-dir-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const fs = require('fs');
const path = require('path');

module.exports = function (context) {
module.exports = function noDirImportRule(context) {
return {
ImportDeclaration: checkImportPath,
ExportNamedDeclaration: checkImportPath,
Expand Down
1 change: 1 addition & 0 deletions src/jsutils/__tests__/inspect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ describe('inspect', () => {
(Foo.prototype: any)[Symbol.toStringTag] = 'Bar';
expect(inspect([[new Foo()]])).to.equal('[[[Bar]]]');

// eslint-disable-next-line func-names
const objectWithoutClassName = new (function () {
// eslint-disable-next-line no-invalid-this
this.foo = 1;
Expand Down
32 changes: 19 additions & 13 deletions src/subscription/__tests__/subscribe-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -897,12 +897,14 @@ describe('Subscription Publish Phase', () => {
});

it('should handle error during execution of source event', async () => {
async function* generateEmails() {
yield { email: { subject: 'Hello' } };
yield { email: { subject: 'Goodbye' } };
yield { email: { subject: 'Bonjour' } };
}

const erroringEmailSchema = emailSchemaWithResolvers(
async function* () {
yield { email: { subject: 'Hello' } };
yield { email: { subject: 'Goodbye' } };
yield { email: { subject: 'Bonjour' } };
},
generateEmails,
(event) => {
if (event.email.subject === 'Goodbye') {
throw new Error('Never leave.');
Expand Down Expand Up @@ -975,11 +977,13 @@ describe('Subscription Publish Phase', () => {
});

it('should pass through error thrown in source event stream', async () => {
async function* generateEmails() {
yield { email: { subject: 'Hello' } };
throw new Error('test error');
}

const erroringEmailSchema = emailSchemaWithResolvers(
async function* () {
yield { email: { subject: 'Hello' } };
throw new Error('test error');
},
generateEmails,
(email) => email,
);

Expand Down Expand Up @@ -1029,11 +1033,13 @@ describe('Subscription Publish Phase', () => {
});

it('should resolve GraphQL error from source event stream', async () => {
async function* generateEmails() {
yield { email: { subject: 'Hello' } };
throw new GraphQLError('test error');
}

const erroringEmailSchema = emailSchemaWithResolvers(
async function* () {
yield { email: { subject: 'Hello' } };
throw new GraphQLError('test error');
},
generateEmails,
(email) => email,
);

Expand Down