8000 Rename `iteration()` => `iterate()` by andywer · Pull Request #6 · andywer/leakage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rename iteration() => iterate() #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const iteration = require('./iteration')
const iterate = require('./iterate')

module.exports = {
iteration
iterate,
iteration: iterate // @deprecated Just here because v0.1.0 exported it as `iteration`.
}
4 changes: 2 additions & 2 deletions lib/iteration.js → lib/iterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ const { getSubsequentHeapGrowths } = require('./heapDiffUtil')
const createLeakErrorFactory = require('./leakErrorFactory')
const saveHeapDiffs = require('./saveHeapDiffs')

module.exports = iteration
module.exports = iterate

/**
* @param {number} iterationCount
* @param {Function} iteratorFunc
*/
function iteration (iterationCount, iteratorFunc) {
function iterate (iterationCount, iteratorFunc) {
const garbageCollections = 6
const throwOnSubsequentHeapGrows = 4
iterationCount = iterationCount > garbageCollections ? iterationCount : garbageCollections
Expand Down
4 changes: 2 additions & 2 deletions test/sample.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Run with Mocha (Jest should work just fine, too)

const sampleLib = require('./sampleLib')
const { iteration } = require('../lib')
const iterate = require('../lib').iterate

describe('sampleLib', () => {
it('does not leak when creating instances and doing stuff', () => {
iteration(100, () => {
iterate(100, () => {
const instance = sampleLib.createInstance() // <- memory leak in here
instance.doStuff()
})
Expand Down
0