This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains 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
const MAX_DEVIATION_SUPPORTED = 0.35 | |
function average(items) { | |
const total = items.reduce((prev, next) => { | |
return prev + next | |
}, 0) | |
return total / items.length | |
} |
This file contains 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
class Calculator { | |
// This is an empty class | |
} |
This file contains 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
describe("Calculator", function() { | |
var calculator; | |
beforeEach(function() { | |
calculator = new Calculator(); | |
}); | |
it("should have an add method", function() { | |
expect(calculator.add).toBeDefined() | |
}); | |
}); |
This file contains 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
class Calculator { | |
add = () => { | |
// Empty method | |
} | |
} |
This file contains 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
describe('add method', () => { | |
it('should return 4 when receiving 2 and 2', () => { | |
expect(calculator.add(2, 2)).toEqual(4) | |
}) | |
}) |
This file contains 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
class Calculator { | |
add = () => { | |
return 4 | |
} | |
} |
This file contains 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
describe('add method', () => { | |
it('should return a SUM when receiving two different numbers', () => { | |
for (var i = 0; i < 100; i++) { | |
const valueA = Math.round(Math.random() * 100) | |
const valueB = Math.round(Math.random() * 100) | |
const sum = valueA + valueB | |
expect(calculator.add(valueA, valueB)).toEqual(sum) | |
} | |
}) | |
}) |
This file contains 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
class Calculator { | |
add = (a, b) => { | |
return a + b | |
} | |
} |
This file contains 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
const fs = require('fs') | |
const ffmpeg = require('fluent-ffmpeg') | |
const path = require('path') | |
const FRAMES_PER_SECOND = 30 | |
const framesFolder = path.resolve('myfolder', 'videos', 'frames') | |
function getAllFilesFromFolder(folderPath, extension) { | |
return new Promise((resolve, reject) => { |