1 | 'use strict'
|
2 | const describe = require('mocha').describe
|
3 | const it = require('mocha').it
|
4 | const expect = require('chai').expect
|
5 | const createMDScope = require('./create-md-scope')
|
6 |
|
7 | describe('createMDScope', () => {
|
8 | it('should init sync and async plugins', () => {
|
9 | function syncPlugin (opts) {
|
10 | return { foo: 'foo' }
|
11 | }
|
12 |
|
13 | function asyncPlugin (opts) {
|
14 | return Promise.resolve({ bar: 'bar' })
|
15 | }
|
16 |
|
17 | return createMDScope([syncPlugin, asyncPlugin], {})
|
18 | .then(scope => {
|
19 | expect(scope).to.eql({
|
20 | foo: 'foo',
|
21 | bar: 'bar',
|
22 | })
|
23 | })
|
24 | })
|
25 | })
|