Skip to content

Bug: GraphQL error behaves differently on Travis #1286

Open
@lperson

Description

@lperson

Describe the bug
When running locally, expect(result.errors[0].message.status).toEqual(403); passes. On travis, result.errors[0].message.status is undefined.

In __test__/server/api/campaign.test.js we expect failure cases in the Bulk Send tests to return the following. We obtained this with console.log(result.errors[0]) in the function expectErrorBulkSending.

    GraphQLError {
      message:
       { status: 403,
         message: 'Not allowed to send all messages at once' },
      locations: [ { line: 3, column: 9 } ],
      path: [ 'bulkSendMessages' ] }

Instead, on travis, the same console.log causes this error:

console.log __test__/server/api/campaign.test.js:832
1978    { errors:
1979       [ TypeError: Cannot convert object to primitive value
1980             at Function.prepareStackTrace (/home/travis/build/MoveOnOrg/Spoke/node_modules/source-map-support/source-map-support.js:394:16)
1981             at new GraphQLError (/home/travis/build/MoveOnOrg/Spoke/node_modules/graphql/error/GraphQLError.js:111:38)
1982             at locatedError (/home/travis/build/MoveOnOrg/Spoke/node_modules/graphql/error/locatedError.js:23:10)
1983             at /home/travis/build/MoveOnOrg/Spoke/node_modules/graphql/execution/execute.js:583:55
1984             at run (/home/travis/build/MoveOnOrg/Spoke/node_modules/core-js/library/modules/es6.promise.js:75:22)
1985             at /home/travis/build/MoveOnOrg/Spoke/node_modules/core-js/library/modules/es6.promise.js:92:30
1986             at flush (/home/travis/build/MoveOnOrg/Spoke/node_modules/core-js/library/modules/_microtask.js:18:9)
1987             at process._tickCallback (internal/process/next_tick.js:61:11) ],
1988      data: { bulkSendMessages: null } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testingArea: a test, testing coverage, meta discussions about testingC-bugType: BugS-needs confirmationStatus: Need to check if this is still an issue and can be reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions