Snapshot Testing Failing #3322
-
I'm trying a simple snapshot test on a project type that extends the JSII project type and it's failing. Test: const snapshot = Testing.synth(project);
test("project snapshot", () => {
expect(snapshot).toMatchSnapshot();
}); Error: Trying to capture a snapshot of a project outside of tmpdir, which implies this test might corrupt an existing project I read through these docs, but didn't see anything to immediately explain it. I also tried looking at projen's own tests, but didn't see any project options that looked unique other than I figure it might have something to do with needing to set a temp snapshot directory? But can't figure out how to do that. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Figured it out. I did in fact need to pass it an const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'my-test'));
const project = new Project({ outdir: tmpdir }); |
Beta Was this translation helpful? Give feedback.
-
This is a bug. Revert PR: #3334 |
Beta Was this translation helpful? Give feedback.
This is a bug. Revert PR: #3334