This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import testModule from '../src/test'; | |
import { expect } from 'chai'; | |
import sinon from 'sinon'; | |
import fs from 'fs'; | |
describe('testModule', () => { | |
let readFileSyncStub: sinon.SinonStub; | |
let sandbox; | |
beforeEach(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
async function doSomething(waitTime) { | |
// because setTimeout does not return a promise (yet) | |
// we have to wrap it in a promise and wait for it to resolve | |
return new Promise(function(resolve) { | |
setTimeout(resolve, waitTime); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const path = require('path'); | |
const NodeZip = require('node-zip'); | |
class JsonZipper { | |
constructor(path) { | |
this.path = path; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const path = require('path'); | |
const NodeZip = require('node-zip'); | |
class JsonZipper { | |
constructor(path) { | |
this.path = path; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Promise = require('bluebird'); | |
const PromiseRetry = require('bluebird-retry'); | |
const request = require('request'); | |
const retryConfig = { | |
timeout: 20000, // 20 seconds | |
interval: 2000, // retry every 10 seconds | |
max_tries: 10 // 10 retries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Promise = require('bluebird'); | |
class Test { | |
constructor() { | |
this.count = 0; | |
} | |
doSomething() { | |
const self = this; |