Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: bluelovers ka
Added: Nov 30, 2017 3:34 PM
Modified: Nov 22, 2018 1:36 AM
Views: 14
Tags: chai dev mocha test
  1. // @ts-ignore
  2. import * as _chai from 'chai';
  3. // @ts-ignore
  4. // @ts-ignore
  5. //import { expect, assert } from 'chai';
  6.  
  7. import ChaiPlugin from 'chai-asserttype-extra'
  8. //import ChaiPlugin = require('chai-asserttype-extra');
  9.  
  10. const chai = ChaiPlugin.install(_chai);
  11. let { expect, assert } = chai;
  12.  
  13. export { chai, expect, assert }
  14.  
  15. // @ts-ignore
  16. import * as path from 'path';
  17. // @ts-ignore
  18. import * as util from 'util';
  19.  
  20. export { path, util };
  21.  
  22. // @ts-ignore
  23. export const rootDir: string = path.join(__dirname, '..');
  24.  
  25. export function relative(filename: string): string
  26. {
  27.         return path.relative(rootDir, filename);
  28. }
  29.  
  30. export function mochaAsync(fn: Function)
  31. {
  32.         return async (done) =>
  33.         {
  34.                 try
  35.                 {
  36.                         await fn();
  37.                         done();
  38.                 }
  39.                 catch (err)
  40.                 {
  41.                         done(err);
  42.                 }
  43.         };
  44. }
  45.  
  46. import * as self from './_local-dev';
  47. export default self;
  48.