2.2.1 • Published 8 months ago

@storyous/test-utils v2.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
8 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.2.1

8 months ago

2.2.0

8 months ago

2.1.0

11 months ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago