sparse-intern-71089
11/01/2023, 5:20 PMfreezing-electrician-6256
11/01/2023, 5:22 PMError: Cannot find module '/home/myuser/path/pulumi-component-resources/my_component' imported from /home/myuser/path/pulumi-component-resources/tests/my_component_test.ts
and i am doing the import like this
before(async function () {
// It's important to import the program _after_ the mocks are defined.
module = await import("../my_component");
});
the ts file does exist in the place expectedfreezing-electrician-6256
11/01/2023, 5:23 PMlittle-cartoon-10569
11/01/2023, 7:27 PMfreezing-electrician-6256
11/01/2023, 10:01 PMlittle-cartoon-10569
11/01/2023, 10:22 PMfreezing-electrician-6256
11/01/2023, 10:22 PMlittle-cartoon-10569
11/01/2023, 10:23 PM{
"name": "project",
"type": "module",
"module": "esnext",
"target": "es2020",
...
little-cartoon-10569
11/01/2023, 10:26 PMstale-answer-34162
11/02/2023, 7:41 PMlittle-cartoon-10569
11/02/2023, 7:41 PMlittle-cartoon-10569
11/02/2023, 7:42 PMstale-answer-34162
11/02/2023, 7:42 PMlittle-cartoon-10569
11/02/2023, 7:43 PMstale-answer-34162
11/02/2023, 7:43 PMstale-answer-34162
11/02/2023, 7:44 PMlittle-cartoon-10569
11/02/2023, 7:44 PMstale-answer-34162
11/02/2023, 7:44 PMlittle-cartoon-10569
11/02/2023, 7:47 PMpromise()
method on OutputInstance<>
.
3. For AWS resources, set the ARN in your resource creation function in setMocks()
. You'll need to soooo often.
The recommendations are:
1. Write your tests before your code.
2. Don't write tests, describe decisions you've made about how you want your project to work.
3. Keep your tests short.