chore(package): update jasmine to version 3.0.0 (#4553)

* chore(package): update jasmine to version 3.0.0

Closes #4547

* Fixes failing tests for jasmine 3.0

Starting 3.0, done(something) will fail

* Update tests so they dont leverage var, but let and const

With jasmine 3.0, the randomization engine was making the test fails because of the scope of `var`

* Remove randomizer

* Use same adapter for PG tests, drop table to ensure the tests dont side effect
This commit is contained in:
Florent Vilmart
2018-02-17 09:55:30 -05:00
committed by GitHub
parent 8ec7785d53
commit b754d51e8e
81 changed files with 2698 additions and 2704 deletions

View File

@@ -1,9 +1,9 @@
var AdaptableController = require("../src/Controllers/AdaptableController").AdaptableController;
var FilesAdapter = require("../src/Adapters/Files/FilesAdapter").default;
var FilesController = require("../src/Controllers/FilesController").FilesController;
const AdaptableController = require("../src/Controllers/AdaptableController").AdaptableController;
const FilesAdapter = require("../src/Adapters/Files/FilesAdapter").default;
const FilesController = require("../src/Controllers/FilesController").FilesController;
var MockController = function(options) {
const MockController = function(options) {
AdaptableController.call(this, options);
}
MockController.prototype = Object.create(AdaptableController.prototype);
@@ -11,8 +11,8 @@ MockController.prototype.constructor = AdaptableController;
describe("AdaptableController", ()=>{
it("should use the provided adapter", (done) => {
var adapter = new FilesAdapter();
var controller = new FilesController(adapter);
const adapter = new FilesAdapter();
const controller = new FilesController(adapter);
expect(controller.adapter).toBe(adapter);
// make sure _adapter is private
expect(controller._adapter).toBe(undefined);
@@ -23,7 +23,7 @@ describe("AdaptableController", ()=>{
});
it("should throw when creating a new mock controller", (done) => {
var adapter = new FilesAdapter();
const adapter = new FilesAdapter();
expect(() => {
new MockController(adapter);
}).toThrow();
@@ -32,9 +32,9 @@ describe("AdaptableController", ()=>{
it("should fail setting the wrong adapter to the controller", (done) => {
function WrongAdapter() {}
var adapter = new FilesAdapter();
var controller = new FilesController(adapter);
var otherAdapter = new WrongAdapter();
const adapter = new FilesAdapter();
const controller = new FilesController(adapter);
const otherAdapter = new WrongAdapter();
expect(() => {
controller.adapter = otherAdapter;
}).toThrow();
@@ -43,7 +43,7 @@ describe("AdaptableController", ()=>{
it("should fail to instantiate a controller with wrong adapter", (done) => {
function WrongAdapter() {}
var adapter = new WrongAdapter();
const adapter = new WrongAdapter();
expect(() => {
new FilesController(adapter);
}).toThrow();
@@ -58,7 +58,7 @@ describe("AdaptableController", ()=>{
});
it("should accept an object adapter", (done) => {
var adapter = {
const adapter = {
createFile: function() { },
deleteFile: function() { },
getFileData: function() { },
@@ -77,7 +77,7 @@ describe("AdaptableController", ()=>{
AGoodAdapter.prototype.getFileData = function() { };
AGoodAdapter.prototype.getFileLocation = function() { };
var adapter = new AGoodAdapter();
const adapter = new AGoodAdapter();
expect(() => {
new FilesController(adapter);
}).not.toThrow();