Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

sheetbase/testing_v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sheetbase Testing

Tools for testing Sheetbase backend.

Install

npm install --save-dev @sheetbase/testing

Usage

// import testing browser
import { Browser } from '@sheetbase/testing';

// import app instance
import * as App from '../src/index';

// init a browser instance for the app
const browser = new Browser(App);

// begin test
describe('Home routes', () => {

    it('GET /', () => {
        const { body } = browser.get('/');
        expect(body).to.contain('Sheetbase Backend');
    });

    it('POST /', () => {
        const { body } = browser.post('/');
        expect(body.data).to.eql({ title: 'Sheetbase Backend' });
    });

});

API

const browser = new Browser(App);

// GET /
const { body } = browser.get('/', { /* params */ });

// POST /xxx
const { body } = browser.post('/xxx', { /* params */ }, { /* body */ });

// PUT /
const { body } = browser.put('/', { /* params */ }, { /* body */ });

// PATCH /
const { body } = browser.patch('/', { /* params */ }, { /* body */ });

// DELETE /
const { body } = browser.delete('/', { /* params */ }, { /* body */ });

License

This package is released under the MIT license.

About

⛔️ DEPRECATED, Tools for testing Sheetbase backend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published