<commit_before>var Application = require('spectron').Application;
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
var path = require('path');

chai.should();
chai.use(chaiAsPromised);

var afterEach = global.afterEach;
var beforeEach = global.beforeEach;
var describe = global.describe;
var it = global.it;

var expect = chai.expect;

describe('demo app', function () {
  this.timeout(30000);

  beforeEach(function () {
    this.app = new Application({
      path: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'),
      args: [
        path.join(__dirname, '..')
      ],
      waitTimeout: 10000
    });
    return this.app.start();
  });

  beforeEach(function () {
    chaiAsPromised.transferPromiseness = this.app.client.transferPromiseness;
  });

  afterEach(function () {
    if (this.app && this.app.isRunning()) {
      return this.app.stop();
    }
  });

  it('opens a window and lists the API sections', function () {
    return this.app.client.waitUntilWindowLoaded()
      .getWindowCount().should.eventually.equal(1)
      .isWindowMinimized().should.eventually.be.false
      .isWindowDevToolsOpened().should.eventually.be.false
      .isWindowVisible().should.eventually.be.true
      .isWindowFocused().should.eventually.be.true
      .getWindowWidth().should.eventually.equal(800)
      .getWindowHeight().should.eventually.equal(733)
      .getTitle().should.eventually.equal('Electron API Demos')
      .elements('section').then(function (response) {
        expect(response.status).to.equal(0);
        expect(response.value.length).to.equal(6);
      });
  });

  describe('when clicking on a section', function () {
    it('opens the selected section', function () {
      return this.app.client.waitUntilWindowLoaded()
        .click('a').pause(1000)
        .waitForVisible('.task-page')
        .getText('h1').should.eventually.equal('Use system dialogs');
    });
    it('all tasks are collapsed', function () {
      return this.app.client.isVisible('.toggle-content')
        .should.eventually.equal(false);
    });
  });
});<commit_msg>Cleanup assert<commit_after>var Application = require('spectron').Application;
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
var path = require('path');

chai.should();
chai.use(chaiAsPromised);

var afterEach = global.afterEach;
var beforeEach = global.beforeEach;
var describe = global.describe;
var it = global.it;

var expect = chai.expect;

describe('demo app', function () {
  this.timeout(30000);

  beforeEach(function () {
    this.app = new Application({
      path: path.join(__dirname, '..', 'node_modules', '.bin', 'electron'),
      args: [
        path.join(__dirname, '..')
      ],
      waitTimeout: 10000
    });
    return this.app.start();
  });

  beforeEach(function () {
    chaiAsPromised.transferPromiseness = this.app.client.transferPromiseness;
  });

  afterEach(function () {
    if (this.app && this.app.isRunning()) {
      return this.app.stop();
    }
  });

  it('opens a window and lists the API sections', function () {
    return this.app.client.waitUntilWindowLoaded()
      .getWindowCount().should.eventually.equal(1)
      .isWindowMinimized().should.eventually.be.false
      .isWindowDevToolsOpened().should.eventually.be.false
      .isWindowVisible().should.eventually.be.true
      .isWindowFocused().should.eventually.be.true
      .getWindowWidth().should.eventually.equal(800)
      .getWindowHeight().should.eventually.equal(733)
      .getTitle().should.eventually.equal('Electron API Demos')
      .elements('section').then(function (response) {
        expect(response.status).to.equal(0);
        expect(response.value.length).to.equal(6);
      });
  });

  describe('when clicking on a section', function () {
    it('opens the selected section', function () {
      return this.app.client.waitUntilWindowLoaded()
        .click('a').pause(1000)
        .waitForVisible('.task-page')
        .getText('h1').should.eventually.equal('Use system dialogs');
    });
    it('all tasks are collapsed', function () {
      return this.app.client
        .isVisible('.toggle-content').should.eventually.be.false;
    });
  });
});
{'fraction_non_alphanumeric': 0.16071005917159764, 'fraction_numerical': 0.01136094674556213, 'mean_word_length': 3.3611971104231166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4575601', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1281, 'n_words': 217}