-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
9 changed files
with
143 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { render } from '@testing-library/svelte'; | ||
import Index from './index.svelte'; | ||
|
||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
/** | ||
* An example test suite outlining the usage of | ||
* `describe()`, `beforeEach()`, `test()` and `expect()` | ||
* | ||
* @see https://jestjs.io/docs/getting-started | ||
* @see https://github.com/testing-library/jest-dom | ||
*/ | ||
|
||
describe('Index', () => { | ||
|
||
let renderedComponent; | ||
|
||
beforeEach(() => { | ||
renderedComponent = render(Index); | ||
}); | ||
|
||
describe('once the component has been rendered', () => { | ||
|
||
test('should show the proper heading', () => { | ||
expect(renderedComponent.getByText('Welcome to SvelteKit')).toBeInTheDocument(); | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { render, RenderResult } from '@testing-library/svelte'; | ||
import Index from './index.svelte'; | ||
|
||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
|
||
/** | ||
* An example test suite outlining the usage of | ||
* `describe()`, `beforeEach()`, `test()` and `expect()` | ||
* | ||
* @see https://jestjs.io/docs/getting-started | ||
* @see https://github.com/testing-library/jest-dom | ||
*/ | ||
|
||
describe('Index', () => { | ||
|
||
let renderedComponent: RenderResult; | ||
|
||
beforeEach(() => { | ||
renderedComponent = render(Index); | ||
}); | ||
|
||
describe('once the component has been rendered', () => { | ||
|
||
test('should show the proper heading', () => { | ||
expect(renderedComponent.getByText('Welcome to SvelteKit')).toBeInTheDocument(); | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
/** | ||
* @jest-environment jsdom | ||
* An example test suite outlining the usage of | ||
* `describe()`, `beforeEach()`, `test()` and `expect()` | ||
* | ||
* @see https://jestjs.io/docs/getting-started | ||
*/ | ||
|
||
import '@testing-library/jest-dom/extend-expect'; | ||
import { render } from '@testing-library/svelte'; | ||
import index from './index.svelte'; | ||
describe('Index', () => { | ||
|
||
let isTestSuitePassing = false; | ||
|
||
beforeEach(() => { | ||
isTestSuitePassing = true; | ||
}); | ||
|
||
describe('isTestSuitePassing', () => { | ||
|
||
test('should be true', () => { | ||
expect(isTestSuitePassing).toBe(true); | ||
}); | ||
|
||
}); | ||
|
||
test('shows proper heading when rendered', () => { | ||
const { getByText } = render(index); | ||
expect(getByText('Hello world!')).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
/** | ||
* @jest-environment jsdom | ||
* An example test suite outlining the usage of | ||
* `describe()`, `beforeEach()`, `test()` and `expect()` | ||
* | ||
* @see https://jestjs.io/docs/getting-started | ||
*/ | ||
|
||
import '@testing-library/jest-dom/extend-expect'; | ||
import { render } from '@testing-library/svelte'; | ||
import index from './index.svelte'; | ||
describe('Index', () => { | ||
|
||
let isTestSuitePassing = false; | ||
|
||
beforeEach(() => { | ||
isTestSuitePassing = true; | ||
}); | ||
|
||
describe('isTestSuitePassing', () => { | ||
|
||
test('should be true', () => { | ||
expect(isTestSuitePassing).toBe(true); | ||
}); | ||
|
||
}); | ||
|
||
test('shows proper heading when rendered', () => { | ||
const { getByText } = render(index); | ||
expect(getByText('Hello world!')).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters