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 <as-cii@github.com>
This commit is contained in:
Jason Rudolph
2019-06-13 11:16:53 -04:00
parent 83119fb3e4
commit f9405cb25d

View File

@@ -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();