Giter Club home page Giter Club logo

Comments (7)

RobinCK avatar RobinCK commented on June 6, 2024

try this

const entity: any = await builder.build(fixture);

from typeorm-fixtures.

Feelthewind avatar Feelthewind commented on June 6, 2024

Thank you for the help, RobinCK.
The error i mentioned disappeared, but another one shows up.
I checked that it succeed resolving User.yml file by logging.

[
        {
          parameters: {},
          processor: undefined,
          entity: 'User',
          name: 'user1',
          data: {
            name: '{{name.firstName}}',
            email: '{{internet.email}}',
            password: 'password'
          },
          dependencies: []
        },
        {
          parameters: {},
          processor: undefined,
          entity: 'User',
          name: 'user2',
          data: {
            name: '{{name.firstName}}',
            email: '{{internet.email}}',
            password: 'password'
          },
          dependencies: []
        }
      ]
Cannot use a pool after calling end on the pool

      at Pool.connect (../node_modules/pg-pool/index.js:148:19)
      at ../src/driver/postgres/PostgresDriver.ts:721:25
      at PostgresDriver.Object.<anonymous>.PostgresDriver.obtainMasterConnection (../src/driver/postgres/PostgresDriver.ts:720:16)
      at PostgresQueryRunner.Object.<anonymous>.PostgresQueryRunner.connect (../src/driver/postgres/PostgresQueryRunner.ts:90:58)
      at PostgresQueryRunner.<anonymous> (../src/driver/postgres/PostgresQueryRunner.ts:163:55)
      at step (../node_modules/tslib/tslib.js:136:27)
      at Object.next (../node_modules/tslib/tslib.js:117:57)
      at ../node_modules/tslib/tslib.js:110:75
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.

      at Object.getCodec (../node_modules/iconv-lite/lib/index.js:65:27)
      at Object.getDecoder (../node_modules/iconv-lite/lib/index.js:127:23)
      at getDecoder (../node_modules/raw-body/index.js:45:18)
      at readStream (../node_modules/raw-body/index.js:180:15)
      at getRawBody (../node_modules/raw-body/index.js:108:12)

I make use of the connection from @InjectConnection() decorator. It might have nothing to do with this library. But i have no idea how to solve it 😭

from typeorm-fixtures.

RobinCK avatar RobinCK commented on June 6, 2024

if to use CLI, everything works fine?

from typeorm-fixtures.

Feelthewind avatar Feelthewind commented on June 6, 2024

Yes. I just tried it and if i use cli, everything works okay. But for e2e testing, i guess i need to do it programmatically so.

from typeorm-fixtures.

RobinCK avatar RobinCK commented on June 6, 2024

Can you create a mini-sample project? For live check

from typeorm-fixtures.

Feelthewind avatar Feelthewind commented on June 6, 2024

Thank you for your time! https://github.com/Feelthewind/parking-tes/tree/master/nodejs
This is the project i'm working on. You can just change the test.yml from /nodejs/config/test.yml here.

from typeorm-fixtures.

johannesschobel avatar johannesschobel commented on June 6, 2024

did you solve the issue?

from typeorm-fixtures.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.