Skip to content

Commit

Permalink
Ensure that test actually fails when things are broken
Browse files Browse the repository at this point in the history
Test could never actually fail, because the only thing it doess is
checks that `test_indicator` element exists and that element was shown
regardless of test result. Fixed that by giving different test ids to
success and failure indicators.

At the moment, tests deliberately fail because custom databases are not
supported.
  • Loading branch information
Sergey Tatarintsev committed May 10, 2024
1 parent 9b9a07a commit 841a51a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/update-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
type: string
required: true
version:
description: npm version to publish
description: client version to update to and publish
type: string
required: true
secrets:
Expand All @@ -19,10 +19,14 @@ on:
inputs:
npmTag:
description: npm tag to publish to
type: string
type: choice
options:
- latest
- dev
- integration
required: true
version:
description: npm version to publish
description: client version to update to and publish
type: string
required: true

Expand Down Expand Up @@ -93,7 +97,9 @@ jobs:
run: yarn npm publish --tag "$NPM_TAG"

- name: Push
run: git push origin main
env:
GITHUB_REF: ${{ github.ref }}
run: git push origin "$GITHUB_REF"

notify-on-failure:
name: Notify on publish failure
Expand Down
2 changes: 1 addition & 1 deletion example/e2e/starter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ describe('Example', () => {
});

it('Show basic test passed indicator', async () => {
await expect(element(by.id('test_indicator'))).toBeVisible();
await expect(element(by.id('test_indicator_success'))).toBeVisible();
});
});
4 changes: 2 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ export default function App() {
{e2eSuccess ? (
<View
className="rounded-full h-3 w-3 bg-green-500"
testID="test_indicator"
testID="test_indicator_success"
/>
) : (
<View
className="rounded-full h-3 w-3 bg-red-500"
testID="test_indicator"
testID="test_indicator_failure"
/>
)}
</View>
Expand Down
1 change: 1 addition & 0 deletions example/src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Chance from 'chance';
const chance = new Chance();

const basePrisma = new PrismaClient({
datasourceUrl: 'file:./my-custom.db',
log: [{ emit: 'event', level: 'query' }],
});

Expand Down

0 comments on commit 841a51a

Please sign in to comment.