export const javascript = 'var component = {\n\tname: "react-codemirror",\n\tauthor: "Jed Watson",\n\trepo: "https://github.com/JedWatson/react-codemirror"\n};';

export const eslintTest = 'var undefinedVals';

export const libUrls = [];

export const tests = {
  greeting: `describe("Greeting", () => {
  const names = ['Ali', 'Maggie', 'Harvey', 'Alison', 'Aaron'];
    beforeEach(() => sinon.spy(console, 'log'));
    afterEach(() => console.log.restore());
    names.forEach((name) => {
      it("should print a greeting to", () => {
        greeting(name);
        console.log.calledWith("Hello, nice to meet you!").should.be.true;
      });
    });
  });`,
  foods: `describe("Foods", () => {
    it("should exist", () => {
      food.should.be.an("array");
    });
  })`,
  oldStyle: `(function (window, $, _) {
        'use strict';

        mocha.setup('bdd');

        const assert = window.assert = chai.assert;
        const expect = window.expect = chai.expect;
        const mock = window.mock = sinon.mock;
        const should = window.should = chai.should();
        const console = window.console;

        chai.use(function (_chai, _) {
            _chai.Assertion.addMethod('it', function (msg) {
                _.flag(this, 'message', msg);
            });
        });

        describe("About Variables", function () {

            beforeEach(function() {
                sinon.stub(console, 'log');
             });

             afterEach(function() {
               console.log.restore();
             });

            it("should create variables", function () {
                greeting.should.equal('Hello World');
            });

            it('should log Hello World', function() {
              expect(window.console.log.calledOnce).to.be.true;
              (window.console.log.calledWith('Hello World')).should.be.true;
            });
            it("should create variables with different types", function () {
              let exists = [
                { name: myName, type: 'string' },
                { name: myAge, type: 'number' },
                { name: isAdult, type: 'boolean' }
              ];
              exists.forEach(exist => (typeof exist.name).should.equal(exist.type));
              myAge >= 18 ? isAdult.should.be.true : isAdult.should.be.false
            });
            it("should re-assign variables", function () {
                if(jobTitle === 'Junior Software Developer' || !jobTitle){
                  salary.should.equal(60000);
                }
                if(salary === 60000 || !salary){
                  jobTitle.should.equal('Junior Software Developer');
                }
                if( jobTitle === 'Junior Software Developer' && salary === 60000){
                  salary.should.equal(75000);
                  jobTitle.should.equal('Team Lead');
                }
            });

        });

        mocha.run();
}(window, window.$, window._));`,
};
