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: Feb 7, 2018 6:53 PM
Views: 12
Tags: chai dev mocha test
  1. // @ts-ignore
  2. import * as chai from 'chai';
  3. // @ts-ignore
  4. import { expect, assert } from 'chai';
  5. export { chai, expect, assert }
  6.  
  7. // @ts-ignore
  8. import * as path from 'path';
  9. // @ts-ignore
  10. import * as util from 'util';
  11.  
  12. export { path, util };
  13.  
  14. // @ts-ignore
  15. export const rootDir: string = path.join(__dirname, '..');
  16.  
  17. export function relative(filename: string): string
  18. {
  19.         return path.relative(rootDir, filename);
  20. }
  21.  
  22. export function mochaAsync(fn: Function)
  23. {
  24.         return async (done) =>
  25.         {
  26.                 try
  27.                 {
  28.                         await fn();
  29.                         done();
  30.                 }
  31.                 catch (err)
  32.                 {
  33.                         done(err);
  34.                 }
  35.         };
  36. }
  37.  
  38. import * as self from './_local-dev';
  39. export default self;
  40.