UNPKG

598 BJavaScriptView Raw
1'use strict'
2const describe = require('mocha').describe
3const it = require('mocha').it
4const expect = require('chai').expect
5const createMDScope = require('./create-md-scope')
6
7describe('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})