Skip to content

Wierd issue when running with jest #489

@danieljuhl

Description

@danieljuhl

I know this is very little information, but I've encountered the following when executing some tests with Jest, which touches code that connects to MySQL using node-mysql2, but the code makes no queries.

Any ideas on what causes this issue? The code is fine, when executed directly.

PROJECT_FOLDER/node_modules/jest-runtime/build/index.js:439
    const wrapper = this._environment.runScript(script)[
                                                       ^

TypeError: Cannot read property 'Object.<anonymous>' of null
    at Runtime._execModule (PROJECT_FOLDER/node_modules/jest-runtime/build/index.js:439:56)
    at Runtime.requireModule (PROJECT_FOLDER/node_modules/jest-runtime/build/index.js:296:14)
    at Runtime.requireModuleOrMock (PROJECT_FOLDER/node_modules/jest-runtime/build/index.js:365:19)
    at Object.getCodec (PROJECT_FOLDER/node_modules/iconv-lite/lib/index.js:61:27)
    at Object.getDecoder (PROJECT_FOLDER/node_modules/iconv-lite/lib/index.js:118:23)
    at Object.<anonymous>.exports.decode (PROJECT_FOLDER/node_modules/mysql2/lib/parsers/string.js:19:23)
    at Packet.Object.<anonymous>.Packet.readNullTerminatedString (PROJECT_FOLDER/node_modules/mysql2/lib/packets/packet.js:371:23)
    at Function.Object.<anonymous>.Handshake.fromPacket (PROJECT_FOLDER/node_modules/mysql2/lib/packets/handshake.js:19:31)
    at ClientHandshake.Object.<anonymous>.ClientHandshake.handshakeInit (PROJECT_FOLDER/node_modules/mysql2/lib/commands/client_handshake.js:83:38)
    at ClientHandshake.Object.<anonymous>.Command.execute (PROJECT_FOLDER/node_modules/mysql2/lib/commands/command.js:39:20)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions