This file contains hidden or 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
name: Test step output | |
on: | |
workflow_dispatch: | |
inputs: | |
fail_value: | |
description: 'Should fail on > 40' | |
required: true | |
type: number | |
default: 0 |
This file contains hidden or 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
test-frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Helsinki" | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: 'ui/package.json' |
This file contains hidden or 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
// 👇 separate from other types of Jest tests | |
/** | |
* @group integration/api | |
*/ | |
// imports ... | |
it('admin creates user', async () => { | |
await loginAs(Role.ADMIN); // login helper (setup 1 dummy user for each role) |
This file contains hidden or 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
// 👇 separate from other types of Jest tests | |
/** | |
* @group integration/api | |
*/ | |
// imports ... | |
it('admin gets users', async () => { | |
await loginAs(Role.ADMIN); // login helper (setup 1 dummy user for each role) |
This file contains hidden or 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
// imports... | |
@Configuration // for Spring's DI setup | |
class ApiTestDoubles( | |
private val factory: ApiTestDoubleFactory | |
) { | |
// 👇 one for each top-level service | |
@Bean // this method's return value will be in the DI context for others to use | |
fun users(): Users = factory |
This file contains hidden or 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
test("turns on credit check", () => { | |
const result = initializeCreditThingy(42, "boo!!!"); | |
expect(result.creditCheck).toBe(true); | |
}); | |
test("does that other thing", () => { | |
const result = initializeCreditThingy(42, "boo!!!"); |
This file contains hidden or 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
test("turns on credit check ... and also that other thing", () => { | |
const result = initializeCreditThingy(42, "boo!!!"); | |
expect({ | |
creditCheck: result.creditCheck, | |
spamCounter: result.spamCounter | |
}) | |
.toEqual({ | |
creditCheck: true, |
This file contains hidden or 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
test("turns on credit check ... and also that other thing", () => { | |
const result = initializeCreditThingy(42, "boo!!!"); | |
expect([ | |
result.creditCheck, | |
result.spamCounter | |
]) | |
.toEqual([true, 0]); | |
}); |
This file contains hidden or 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
test("turns on credit check ... and also that other thing", () => { | |
const result = initializeCreditThingy(42, "boo!!!"); | |
expect(result.creditCheck).toBe(true); | |
expect(result.spamCounter).toBe(0); | |
}); |
This file contains hidden or 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
interface Params { | |
foo?: string; | |
bar?: number; | |
} | |
function doStuff(params: Params = { foo: "Default", bar: 42}): any[] { | |
return [params.bar, params.foo]; | |
} | |
describe("default params", () => { |
NewerOlder