Skip to content

Commit

Permalink
Add test environment config
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored and braebo committed Sep 6, 2021
1 parent 278ad85 commit 01c1d92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 9 additions & 5 deletions templates/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import "@testing-library/jest-dom/extend-expect";
import { render } from "@testing-library/svelte";
import index from "./index.svelte";
/**
* @jest-environment jsdom
*/

test("shows proper heading when rendered", () => {
import '@testing-library/jest-dom/extend-expect';
import { render } from '@testing-library/svelte';
import index from './index.svelte';

test('shows proper heading when rendered', () => {
const { getByText } = render(index);
expect(getByText("Hello world!")).toBeInTheDocument();
expect(getByText('Hello world!')).toBeInTheDocument();
});
4 changes: 4 additions & 0 deletions templates/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* @jest-environment jsdom
*/

import '@testing-library/jest-dom/extend-expect';
import { render } from '@testing-library/svelte';
import index from './index.svelte';
Expand Down

0 comments on commit 01c1d92

Please sign in to comment.