2.3.0 • Published 10 months ago

@storyous/test-utils v2.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

testUtils

Package for help with testing you app. Creates api for test requesting, creates test database collection and mocked mailer.

Usage

import * as assert from 'assert';
import Koa from 'koa';
import { describe, it } from 'mocha';
import mailer from '@storyous/mailer';
import testUtils from '@storyous/test-utils';

testUtils.init(
 () => new Koa(),
 testUtils.uniqueDatabase('mongodb://127.0.0.0:27017/test'),
 mailer,
);

describe('some test', async () => {

    it('should do some request', async () => {
        await testUtils.request().get('/').expect(200);
    });
    
    it('should getSent emails', async () => {
        await mailer.sendMail({});
        assert.deepStrictEqual(testUtils.getSentMails(), []);
    });
};
2.3.0

10 months ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago