import * as chai from 'chai' ; import chaiAsPromised from 'chai-as-promised' ; import promisifyMsSubtleCrypto from '../src/promisify-ms-crypto' ; import * as fixtures from './fixtures' ; chai . use ( chaiAsPromised ) ; const { expect } = chai ; describe ( 'promisifyMsSubtleCrypto' , ( ) => { const backendComplete = promisifyMsSubtleCrypto ( fixtures . fakeWindowIE11OnComplete . msCrypto . subtle ) ; const backendError = promisifyMsSubtleCrypto ( fixtures . fakeWindowIE11OnError . msCrypto . subtle ) ; it ( 'backendComplete:decrypt' , async ( ) => { const test = await backendComplete . decrypt ( ) ; expect ( test ) . to . equal ( true ) ; } ) ; it ( 'backendError:decrypt' , async ( ) => { await expect ( backendError . decrypt ( ) ) . to . rejectedWith ( Error ) ; } ) ; } ) ;