From f9405cb25d704af13e6647ea467c9a23421576c3 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Thu, 13 Jun 2019 11:16:53 -0400 Subject: [PATCH] Fix test initialization If multiple specs were to populate the events var, one spec would pollute the others. So, let's reset the events var at the beginning of each spec. Co-Authored-By: Antonio Scandurra --- spec/project-spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/project-spec.js b/spec/project-spec.js index f123dc84a..4f69a7f6a 100644 --- a/spec/project-spec.js +++ b/spec/project-spec.js @@ -1042,11 +1042,12 @@ describe('Project', () => { }); describe('.onDidChangeFiles()', () => { - let sub = []; - const events = []; + let sub; + let events; let checkCallback = () => {}; beforeEach(() => { + events = [] sub = atom.project.onDidChangeFiles(incoming => { events.push(...incoming); checkCallback();