-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript based configuration doesn't work when using simple preset setup #73
Comments
What's your jest setup, are you using babel jest? Can I see you babel config? |
Also, I assume you are using the |
Thanks for your quick response. Meanwhile, I am using dynalite directly (without jest-dynalite). I have a import dynalite from "dynalite";
import * as dynamodb from "@aws-sdk/client-dynamodb";
import * as db from "../src/db";
const dynaliteServer = dynalite({ createTableMs: 0, deleteTableMs: 0, updateTableMs: 0 });
process.env.AWS_REGION = "test";
process.env.AWS_ACCESS_KEY_ID = "test";
process.env.AWS_SECRET_ACCESS_KEY = "test";
beforeAll(async () => {
await new Promise<void>((resolve) => dynaliteServer.listen(0, () => resolve()));
const addr = dynaliteServer.address();
if (!addr || typeof addr === "string") {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw new Error(`${addr}`);
}
db.setDdb(new dynamodb.DynamoDB({ endpoint: `http://localhost:${addr.port}` }));
});
beforeEach(async () => {
await db.ddb.deleteTable({ TableName: "table" }).catch((_) => false);
await db.ddb.createTable({
TableName: "table",
KeySchema: [
{ AttributeName: "pk", KeyType: "HASH" },
{ AttributeName: "id", KeyType: "RANGE" },
],
AttributeDefinitions: [
{ AttributeName: "pk", AttributeType: "S" },
{ AttributeName: "id", AttributeType: "S" },
],
BillingMode: "PAY_PER_REQUEST",
});
});
afterAll(async () => {
await new Promise<void>((resolve) => dynaliteServer.close(() => resolve()));
}); and just link it with: |
Cool, you can recreate this with the advanced setup. I'm going to leave this open whilst I work out what to do with |
As a suggestion it might be better to allow ES6 module configuration in the 'Simple' setup (and deprecate CommonJS) in the next major release. |
I'm not sure that will help? I think the issue is |
I get this error too using ES modules and I tried renaming the file to
|
I am trying to load a typescript config with jest-dynalite.
Everything else in my project is TypeScript and works fine. I am having a babel.config.json.
The text was updated successfully, but these errors were encountered: