Skip to content

Commit

Permalink
Create api.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 6, 2024
1 parent d3db5e7 commit 7c772ec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions testing/integration/cypress/integration/api.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// cypress/integration/api.spec.ts
describe('API', () => {
it('returns a list of users', () => {
cy.request('GET', 'https://example.com/api/users').then(response => {
expect(response.body).to.be.an('array');
});
});

it('creates a new user', () => {
cy.request('POST', 'https://example.com/api/users', {
name: 'John Doe',
email: '[email protected]',
}).then(response => {
expect(response.body).to.have.property('id');
});
});
});

0 comments on commit 7c772ec

Please sign in to comment.