From a1589a679cfee2c2e3588faa9007b57f2fcd6aff Mon Sep 17 00:00:00 2001 From: Tim Lai Date: Tue, 23 Jun 2020 10:16:23 -0700 Subject: [PATCH] style: replace var with let in /test files (#6164) --- .../helpers/oauth2-server/index.js | 16 +- .../helpers/oauth2-server/model.js | 30 +- test/mocha/core/curlify.js | 32 +- test/mocha/core/plugins/samples/fn.js | 278 +++++++++--------- test/mocha/core/system/system.jsx | 42 +-- test/mocha/core/system/wrapComponent.jsx | 10 +- 6 files changed, 204 insertions(+), 204 deletions(-) diff --git a/test/e2e-cypress/helpers/oauth2-server/index.js b/test/e2e-cypress/helpers/oauth2-server/index.js index ba779352..3e5534c9 100644 --- a/test/e2e-cypress/helpers/oauth2-server/index.js +++ b/test/e2e-cypress/helpers/oauth2-server/index.js @@ -1,13 +1,13 @@ // from https://github.com/pedroetb/node-oauth2-server-example -var Http = require("http") -var path = require("path") -var express = require("express") -var bodyParser = require("body-parser") -var oauthserver = require("oauth2-server") -var cors = require("cors") +let Http = require("http") +let path = require("path") +let express = require("express") +let bodyParser = require("body-parser") +let oauthserver = require("oauth2-server") +let cors = require("cors") -var app = express() +let app = express() app.use(cors()) @@ -34,7 +34,7 @@ app.get("*", app.oauth.authorise(), function (req, res) { app.use(app.oauth.errorHandler()) function startServer() { - var httpServer = Http.createServer(app) + let httpServer = Http.createServer(app) httpServer.listen("3231") return function stopServer() { diff --git a/test/e2e-cypress/helpers/oauth2-server/model.js b/test/e2e-cypress/helpers/oauth2-server/model.js index f5722bf4..d794e8d7 100644 --- a/test/e2e-cypress/helpers/oauth2-server/model.js +++ b/test/e2e-cypress/helpers/oauth2-server/model.js @@ -1,6 +1,6 @@ // from https://github.com/pedroetb/node-oauth2-server-example -var config = { +let config = { clients: [{ clientId: "application", clientSecret: "secret" @@ -21,7 +21,7 @@ var config = { * Dump the memory storage content (for debug). */ -var dump = function () { +let dump = function () { console.log("clients", config.clients) console.log("confidentialClients", config.confidentialClients) @@ -33,9 +33,9 @@ var dump = function () { * Methods used by all grant types. */ -var getAccessToken = function (bearerToken, callback) { +let getAccessToken = function (bearerToken, callback) { - var tokens = config.tokens.filter(function (token) { + let tokens = config.tokens.filter(function (token) { return token.accessToken === bearerToken }) @@ -43,14 +43,14 @@ var getAccessToken = function (bearerToken, callback) { return callback(false, tokens[0]) } -var getClient = function (clientId, clientSecret, callback) { +let getClient = function (clientId, clientSecret, callback) { - var clients = config.clients.filter(function (client) { + let clients = config.clients.filter(function (client) { return client.clientId === clientId && client.clientSecret === clientSecret }) - var confidentialClients = config.confidentialClients.filter(function (client) { + let confidentialClients = config.confidentialClients.filter(function (client) { return client.clientId === clientId && client.clientSecret === clientSecret }) @@ -58,9 +58,9 @@ var getClient = function (clientId, clientSecret, callback) { callback(false, clients[0] || confidentialClients[0]) } -var grantTypeAllowed = function (clientId, grantType, callback) { +let grantTypeAllowed = function (clientId, grantType, callback) { - var clientsSource, + let clientsSource, clients = [] if (grantType === "password") { @@ -79,7 +79,7 @@ var grantTypeAllowed = function (clientId, grantType, callback) { callback(false, clients.length) } -var saveAccessToken = function (accessToken, clientId, expires, user, callback) { +let saveAccessToken = function (accessToken, clientId, expires, user, callback) { config.tokens.push({ accessToken: accessToken, @@ -95,9 +95,9 @@ var saveAccessToken = function (accessToken, clientId, expires, user, callback) * Method used only by password grant type. */ -var getUser = function (username, password, callback) { +let getUser = function (username, password, callback) { - var users = config.users.filter(function (user) { + let users = config.users.filter(function (user) { return user.username === username && user.password === password }) @@ -109,14 +109,14 @@ var getUser = function (username, password, callback) { * Method used only by client_credentials grant type. */ -var getUserFromClient = function (clientId, clientSecret, callback) { +let getUserFromClient = function (clientId, clientSecret, callback) { - var clients = config.confidentialClients.filter(function (client) { + let clients = config.confidentialClients.filter(function (client) { return client.clientId === clientId && client.clientSecret === clientSecret }) - var user + let user if (clients.length) { user = { diff --git a/test/mocha/core/curlify.js b/test/mocha/core/curlify.js index 973a6b78..b492c804 100644 --- a/test/mocha/core/curlify.js +++ b/test/mocha/core/curlify.js @@ -6,7 +6,7 @@ import win from "core/window" describe("curlify", function () { it("prints a curl statement with custom content-type", function () { - var req = { + let req = { url: "http://example.com", method: "POST", body: { @@ -26,7 +26,7 @@ describe("curlify", function () { }) it("does add a empty data param if no request body given", function () { - var req = { + let req = { url: "http://example.com", method: "POST", } @@ -37,7 +37,7 @@ describe("curlify", function () { }) it("does not change the case of header in curl", function () { - var req = { + let req = { url: "http://example.com", method: "POST", headers: { @@ -51,7 +51,7 @@ describe("curlify", function () { }) it("prints a curl statement with an array of query params", function () { - var req = { + let req = { url: "http://swaggerhub.com/v1/one?name=john|smith", method: "GET" } @@ -62,7 +62,7 @@ describe("curlify", function () { }) it("prints a curl statement with an array of query params and auth", function () { - var req = { + let req = { url: "http://swaggerhub.com/v1/one?name=john|smith", method: "GET", headers: { @@ -76,7 +76,7 @@ describe("curlify", function () { }) it("prints a curl statement with html", function () { - var req = { + let req = { url: "http://swaggerhub.com/v1/one?name=john|smith", method: "GET", headers: { @@ -93,7 +93,7 @@ describe("curlify", function () { }) it("handles post body with html", function () { - var req = { + let req = { url: "http://swaggerhub.com/v1/one?name=john|smith", method: "POST", headers: { @@ -110,7 +110,7 @@ describe("curlify", function () { }) it("handles post body with special chars", function () { - var req = { + let req = { url: "http://swaggerhub.com/v1/one?name=john|smith", method: "POST", body: { @@ -125,7 +125,7 @@ describe("curlify", function () { }) it("handles delete form with parameters", function () { - var req = { + let req = { url: "http://example.com", method: "DELETE", headers: { @@ -139,7 +139,7 @@ describe("curlify", function () { }) it("should print a curl with formData", function () { - var req = { + let req = { url: "http://example.com", method: "POST", headers: { "content-type": "multipart/form-data" }, @@ -175,11 +175,11 @@ describe("curlify", function () { }) it("should print a curl with formData and file", function () { - var file = new win.File() + let file = new win.File() file.name = "file.txt" file.type = "text/plain" - var req = { + let req = { url: "http://example.com", method: "POST", headers: { "content-type": "multipart/form-data" }, @@ -195,11 +195,11 @@ describe("curlify", function () { }) it("should print a curl without form data type if type is unknown", function () { - var file = new win.File() + let file = new win.File() file.name = "file.txt" file.type = "" - var req = { + let req = { url: "http://example.com", method: "POST", headers: { "content-type": "multipart/form-data" }, @@ -215,7 +215,7 @@ describe("curlify", function () { }) it("prints a curl post statement from an object", function () { - var req = { + let req = { url: "http://example.com", method: "POST", headers: { @@ -232,7 +232,7 @@ describe("curlify", function () { }) it("prints a curl post statement from a string containing a single quote", function () { - var req = { + let req = { url: "http://example.com", method: "POST", headers: { diff --git a/test/mocha/core/plugins/samples/fn.js b/test/mocha/core/plugins/samples/fn.js index 09a77dc7..496adafd 100644 --- a/test/mocha/core/plugins/samples/fn.js +++ b/test/mocha/core/plugins/samples/fn.js @@ -4,7 +4,7 @@ import expect from "expect" describe("sampleFromSchema", function() { it("handles Immutable.js objects for nested schemas", function () { - var definition = fromJS({ + let definition = fromJS({ "type": "object", "properties": { "json": { @@ -21,7 +21,7 @@ describe("sampleFromSchema", function() { } }) - var expected = { + let expected = { json: { a: "string" } @@ -31,7 +31,7 @@ describe("sampleFromSchema", function() { }) it("returns object with no readonly fields for parameter", function () { - var definition = { + let definition = { type: "object", properties: { id: { @@ -47,7 +47,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { id: 0 } @@ -55,7 +55,7 @@ describe("sampleFromSchema", function() { }) it("returns object with readonly fields for parameter, with includeReadOnly", function () { - var definition = { + let definition = { type: "object", properties: { id: { @@ -71,7 +71,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { id: 0, readOnlyDog: "string" } @@ -80,7 +80,7 @@ describe("sampleFromSchema", function() { }) it("returns object without deprecated fields for parameter", function () { - var definition = { + let definition = { type: "object", properties: { id: { @@ -96,7 +96,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { id: 0 } @@ -104,7 +104,7 @@ describe("sampleFromSchema", function() { }) it("returns object without writeonly fields for parameter", function () { - var definition = { + let definition = { type: "object", properties: { id: { @@ -120,7 +120,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { id: 0 } @@ -128,7 +128,7 @@ describe("sampleFromSchema", function() { }) it("returns object with writeonly fields for parameter, with includeWriteOnly", function () { - var definition = { + let definition = { type: "object", properties: { id: { @@ -144,7 +144,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { id: 0, writeOnlyDog: "string" } @@ -153,7 +153,7 @@ describe("sampleFromSchema", function() { }) it("returns object without any $$ref fields at the root schema level", function () { - var definition = { + let definition = { type: "object", properties: { message: { @@ -169,7 +169,7 @@ describe("sampleFromSchema", function() { $$ref: "#/components/schemas/Welcome" } - var expected = { + let expected = { "value": { "message": "Hello, World!" } @@ -179,7 +179,7 @@ describe("sampleFromSchema", function() { }) it("returns object without any $$ref fields at nested schema levels", function () { - var definition = { + let definition = { type: "object", properties: { message: { @@ -197,7 +197,7 @@ describe("sampleFromSchema", function() { $$ref: "#/components/schemas/Welcome" } - var expected = { + let expected = { a: { "value": { "message": "Hello, World!" @@ -209,7 +209,7 @@ describe("sampleFromSchema", function() { }) it("returns object with any $$ref fields that appear to be user-created", function () { - var definition = { + let definition = { type: "object", properties: { message: { @@ -227,7 +227,7 @@ describe("sampleFromSchema", function() { $$ref: "#/components/schemas/Welcome" } - var expected = { + let expected = { $$ref: { "value": { "message": "Hello, World!" @@ -239,7 +239,7 @@ describe("sampleFromSchema", function() { }) it("returns example value for date-time property", function() { - var definition = { + let definition = { type: "string", format: "date-time" } @@ -247,82 +247,82 @@ describe("sampleFromSchema", function() { // 0-20 chops off milliseconds // necessary because test latency can cause failures // it would be better to mock Date globally and expect a string - KS 11/18 - var expected = new Date().toISOString().substring(0, 20) + let expected = new Date().toISOString().substring(0, 20) expect(sampleFromSchema(definition)).toInclude(expected) }) it("returns example value for date property", function() { - var definition = { + let definition = { type: "string", format: "date" } - var expected = new Date().toISOString().substring(0, 10) + let expected = new Date().toISOString().substring(0, 10) expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns a UUID for a string with format=uuid", function() { - var definition = { + let definition = { type: "string", format: "uuid" } - var expected = "3fa85f64-5717-4562-b3fc-2c963f66afa6" + let expected = "3fa85f64-5717-4562-b3fc-2c963f66afa6" expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns a hostname for a string with format=hostname", function() { - var definition = { + let definition = { type: "string", format: "hostname" } - var expected = "example.com" + let expected = "example.com" expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns an IPv4 address for a string with format=ipv4", function() { - var definition = { + let definition = { type: "string", format: "ipv4" } - var expected = "198.51.100.42" + let expected = "198.51.100.42" expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns an IPv6 address for a string with format=ipv6", function() { - var definition = { + let definition = { type: "string", format: "ipv6" } - var expected = "2001:0db8:5b96:0000:0000:426f:8e17:642a" + let expected = "2001:0db8:5b96:0000:0000:426f:8e17:642a" expect(sampleFromSchema(definition)).toEqual(expected) }) describe("for array type", function() { it("returns array with sample of array type", function() { - var definition = { + let definition = { type: "array", items: { type: "integer" } } - var expected = [ 0 ] + let expected = [ 0 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of examples for array that has example", function() { - var definition = { + let definition = { type: "array", items: { type: "string" @@ -330,13 +330,13 @@ describe("sampleFromSchema", function() { example: "dog" } - var expected = [ "dog" ] + let expected = [ "dog" ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of examples for array that has examples", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -344,13 +344,13 @@ describe("sampleFromSchema", function() { example: [ "dog", "cat" ] } - var expected = [ "dog", "cat" ] + let expected = [ "dog", "cat" ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of samples for oneOf type", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -362,13 +362,13 @@ describe("sampleFromSchema", function() { } } - var expected = [ 0 ] + let expected = [ 0 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of samples for oneOf types", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -383,13 +383,13 @@ describe("sampleFromSchema", function() { } } - var expected = [ "string", 0 ] + let expected = [ "string", 0 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of samples for oneOf examples", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -406,13 +406,13 @@ describe("sampleFromSchema", function() { } } - var expected = [ "dog", 1 ] + let expected = [ "dog", 1 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of samples for anyOf type", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -424,13 +424,13 @@ describe("sampleFromSchema", function() { } } - var expected = [ 0 ] + let expected = [ 0 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of samples for anyOf types", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -445,13 +445,13 @@ describe("sampleFromSchema", function() { } } - var expected = [ "string", 0 ] + let expected = [ "string", 0 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns array of samples for anyOf examples", function() { - var definition = { + let definition = { type: "array", items: { type: "string", @@ -468,13 +468,13 @@ describe("sampleFromSchema", function() { } } - var expected = [ "dog", 1 ] + let expected = [ "dog", 1 ] expect(sampleFromSchema(definition)).toEqual(expected) }) it("returns null for a null example", function() { - var definition = { + let definition = { "type": "object", "properties": { "foo": { @@ -485,7 +485,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { foo: null } @@ -493,7 +493,7 @@ describe("sampleFromSchema", function() { }) it("returns null for a null object-level example", function() { - var definition = { + let definition = { "type": "object", "properties": { "foo": { @@ -506,7 +506,7 @@ describe("sampleFromSchema", function() { } } - var expected = { + let expected = { foo: null } @@ -516,10 +516,10 @@ describe("sampleFromSchema", function() { }) describe("createXMLExample", function () { - var sut = createXMLExample + let sut = createXMLExample describe("simple types with xml property", function () { it("returns tag string when passing type string and xml:{name: \"newtagname\"}", function () { - var definition = { + let definition = { type: "string", xml: { name: "newtagname" @@ -530,7 +530,7 @@ describe("createXMLExample", function () { }) it("returns tag string when passing type string and xml:{name: \"newtagname\", prefix:\"test\"}", function () { - var definition = { + let definition = { type: "string", xml: { name: "newtagname", @@ -542,7 +542,7 @@ describe("createXMLExample", function () { }) it("returns tag string when passing type string and xml:{\"namespace\": \"http://swagger.io/schema/sample\", \"prefix\": \"sample\"}", function () { - var definition = { + let definition = { type: "string", xml: { namespace: "http://swagger.io/schema/sample", @@ -555,7 +555,7 @@ describe("createXMLExample", function () { }) it("returns tag string when passing type string and xml:{\"namespace\": \"http://swagger.io/schema/sample\"}", function () { - var definition = { + let definition = { type: "string", xml: { namespace: "http://swagger.io/schema/sample", @@ -567,8 +567,8 @@ describe("createXMLExample", function () { }) it("returns tag test when passing default value", function () { - var expected = "\ntest" - var definition = { + let expected = "\ntest" + let definition = { type: "string", "default": "test", xml: { @@ -580,8 +580,8 @@ describe("createXMLExample", function () { }) it("returns default value when enum provided", function () { - var expected = "\none" - var definition = { + let expected = "\none" + let definition = { type: "string", "default": "one", "enum": ["two", "one"], @@ -594,8 +594,8 @@ describe("createXMLExample", function () { }) it("returns example value when provided", function () { - var expected = "\ntwo" - var definition = { + let expected = "\ntwo" + let definition = { type: "string", "default": "one", "example": "two", @@ -609,8 +609,8 @@ describe("createXMLExample", function () { }) it("sets first enum if provided", function () { - var expected = "\none" - var definition = { + let expected = "\none" + let definition = { type: "string", "enum": ["one", "two"], xml: { @@ -624,8 +624,8 @@ describe("createXMLExample", function () { describe("array", function () { it("returns tag string when passing string items", function () { - var expected = "\nstring" - var definition = { + let expected = "\nstring" + let definition = { type: "array", items: { type: "string" @@ -639,8 +639,8 @@ describe("createXMLExample", function () { }) it("returns tag string when passing string items with name", function () { - var expected = "\nstring" - var definition = { + let expected = "\nstring" + let definition = { type: "array", items: { type: "string", @@ -657,8 +657,8 @@ describe("createXMLExample", function () { }) it("returns tag string when passing string items with name", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "array", items: { type: "string", @@ -676,8 +676,8 @@ describe("createXMLExample", function () { }) it("return correct nested wrapped array", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "array", items: { type: "array", @@ -698,8 +698,8 @@ describe("createXMLExample", function () { }) it("return correct nested wrapped array with xml", function () { - var expected = "\n\n\t\n\t\tstring\n\t\n" - var definition = { + let expected = "\n\n\t\n\t\tstring\n\t\n" + let definition = { type: "array", items: { type: "array", @@ -724,8 +724,8 @@ describe("createXMLExample", function () { }) it("adds namespace to array", function () { - var expected = "\nstring" - var definition = { + let expected = "\nstring" + let definition = { type: "array", items: { type: "string", @@ -744,8 +744,8 @@ describe("createXMLExample", function () { }) it("adds prefix to array", function () { - var expected = "\nstring" - var definition = { + let expected = "\nstring" + let definition = { type: "array", items: { type: "string", @@ -764,8 +764,8 @@ describe("createXMLExample", function () { }) it("adds prefix to array with no xml in items", function () { - var expected = "\nstring" - var definition = { + let expected = "\nstring" + let definition = { type: "array", items: { type: "string" @@ -780,8 +780,8 @@ describe("createXMLExample", function () { }) it("adds namespace to array with no xml in items", function () { - var expected = "\nstring" - var definition = { + let expected = "\nstring" + let definition = { type: "array", items: { type: "string" @@ -796,8 +796,8 @@ describe("createXMLExample", function () { }) it("adds namespace to array with wrapped", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "array", items: { type: "string", @@ -816,8 +816,8 @@ describe("createXMLExample", function () { }) it("adds prefix to array with wrapped", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "array", items: { type: "string", @@ -836,8 +836,8 @@ describe("createXMLExample", function () { }) it("returns wrapped array when type is not passed", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { items: { type: "string", xml: { @@ -854,8 +854,8 @@ describe("createXMLExample", function () { }) it("returns array with default values", function () { - var expected = "\none\ntwo" - var definition = { + let expected = "\none\ntwo" + let definition = { items: { type: "string", xml: { @@ -872,8 +872,8 @@ describe("createXMLExample", function () { }) it("returns array with default values with wrapped=true", function () { - var expected = "\n\n\tone\n\ttwo\n" - var definition = { + let expected = "\n\n\tone\n\ttwo\n" + let definition = { items: { type: "string", xml: { @@ -891,8 +891,8 @@ describe("createXMLExample", function () { }) it("returns array with default values", function () { - var expected = "\none" - var definition = { + let expected = "\none" + let definition = { items: { type: "string", "enum": ["one", "two"], @@ -909,8 +909,8 @@ describe("createXMLExample", function () { }) it("returns array with default values with wrapped=true", function () { - var expected = "\n\n\t1\n\t2\n" - var definition = { + let expected = "\n\n\t1\n\t2\n" + let definition = { items: { "enum": ["one", "two"], type: "string", @@ -929,8 +929,8 @@ describe("createXMLExample", function () { }) it("returns array with example values with ", function () { - var expected = "\n\n\t1\n\t2\n" - var definition = { + let expected = "\n\n\t1\n\t2\n" + let definition = { type: "object", properties: { "animal": { @@ -953,8 +953,8 @@ describe("createXMLExample", function () { }) it("returns array with example values with wrapped=true", function () { - var expected = "\n\n\t1\n\t2\n" - var definition = { + let expected = "\n\n\t1\n\t2\n" + let definition = { type: "array", items: { type: "string", @@ -973,8 +973,8 @@ describe("createXMLExample", function () { }) it("returns array of objects with example values with wrapped=true", function () { - var expected = `\n\n\t\n\t\t1\n\t\tArthur Dent\n\t\n\t\n\t\t2\n\t\tFord Prefect\n\t\n` - var definition = { + let expected = `\n\n\t\n\t\t1\n\t\tArthur Dent\n\t\n\t\n\t\t2\n\t\tFord Prefect\n\t\n` + let definition = { "type": "array", "items": { "type": "object", @@ -1013,8 +1013,8 @@ describe("createXMLExample", function () { describe("object", function () { it("returns object with 2 properties", function () { - var expected = "\n\n\tstring\n\t0\n" - var definition = { + let expected = "\n\n\tstring\n\t0\n" + let definition = { type: "object", properties: { alien: { @@ -1033,8 +1033,8 @@ describe("createXMLExample", function () { }) it("returns object with integer property and array property", function () { - var expected = "\n\n\tstring\n\t0\n" - var definition = { + let expected = "\n\n\tstring\n\t0\n" + let definition = { type: "object", properties: { aliens: { @@ -1056,8 +1056,8 @@ describe("createXMLExample", function () { }) it("returns nested objects", function () { - var expected = "\n\n\t\n\t\tstring\n\t\n\tstring\n" - var definition = { + let expected = "\n\n\t\n\t\tstring\n\t\n\tstring\n" + let definition = { type: "object", properties: { aliens: { @@ -1084,8 +1084,8 @@ describe("createXMLExample", function () { }) it("returns object with no readonly fields for parameter", function () { - var expected = "\n\n\t0\n" - var definition = { + let expected = "\n\n\t0\n" + let definition = { type: "object", properties: { id: { @@ -1105,8 +1105,8 @@ describe("createXMLExample", function () { }) it("returns object with readonly fields for parameter, with includeReadOnly", function () { - var expected = "\n\n\t0\n\tstring\n" - var definition = { + let expected = "\n\n\t0\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1126,8 +1126,8 @@ describe("createXMLExample", function () { }) it("returns object without writeonly fields for parameter", function () { - var expected = "\n\n\t0\n" - var definition = { + let expected = "\n\n\t0\n" + let definition = { type: "object", properties: { id: { @@ -1147,8 +1147,8 @@ describe("createXMLExample", function () { }) it("returns object with writeonly fields for parameter, with includeWriteOnly", function () { - var expected = "\n\n\t0\n\tstring\n" - var definition = { + let expected = "\n\n\t0\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1168,8 +1168,8 @@ describe("createXMLExample", function () { }) it("returns object with passed property as attribute", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1191,8 +1191,8 @@ describe("createXMLExample", function () { }) it("returns object with passed property as attribute with custom name", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1215,8 +1215,8 @@ describe("createXMLExample", function () { }) it("returns object with example values in attribute", function () { - var expected = "\n\n\tadmin\n" - var definition = { + let expected = "\n\n\tadmin\n" + let definition = { type: "object", properties: { id: { @@ -1242,8 +1242,8 @@ describe("createXMLExample", function () { }) it("returns object with enum values in attribute", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1266,8 +1266,8 @@ describe("createXMLExample", function () { }) it("returns object with default values in attribute", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1290,8 +1290,8 @@ describe("createXMLExample", function () { }) it("returns object with default values in attribute", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { type: "object", properties: { id: { @@ -1314,8 +1314,8 @@ describe("createXMLExample", function () { }) it("returns object with example value", function () { - var expected = "\n\n\t42\n\tadmin\n" - var definition = { + let expected = "\n\n\t42\n\tadmin\n" + let definition = { type: "object", properties: { id: { @@ -1338,8 +1338,8 @@ describe("createXMLExample", function () { }) it("returns object with additional props", function () { - var expected = "\n\n\tstring\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n\tstring\n" + let definition = { type: "object", properties: { dog: { @@ -1358,8 +1358,8 @@ describe("createXMLExample", function () { }) it("returns object with additional props =true", function () { - var expected = "\n\n\tstring\n\tAnything can be here\n" - var definition = { + let expected = "\n\n\tstring\n\tAnything can be here\n" + let definition = { type: "object", properties: { dog: { @@ -1376,8 +1376,8 @@ describe("createXMLExample", function () { }) it("returns object with 2 properties with no type passed but properties", function () { - var expected = "\n\n\tstring\n\t0\n" - var definition = { + let expected = "\n\n\tstring\n\t0\n" + let definition = { properties: { alien: { type: "string" @@ -1395,8 +1395,8 @@ describe("createXMLExample", function () { }) it("returns object with additional props with no type passed", function () { - var expected = "\n\n\tstring\n" - var definition = { + let expected = "\n\n\tstring\n" + let definition = { additionalProperties: { type: "string" }, diff --git a/test/mocha/core/system/system.jsx b/test/mocha/core/system/system.jsx index 75912b92..9837a328 100644 --- a/test/mocha/core/system/system.jsx +++ b/test/mocha/core/system/system.jsx @@ -34,7 +34,7 @@ describe("bound system", function(){ }) // When - var action = system.getSystem().joshActions.simple(1) + let action = system.getSystem().joshActions.simple(1) expect(action).toEqual({ type: "newSimple" }) @@ -65,7 +65,7 @@ describe("bound system", function(){ }) // When - var action = system.getSystem().joshActions.simple(1) + let action = system.getSystem().joshActions.simple(1) expect(action).toEqual({ type: "newSimple", oriActionResult: { type: "simple" }, @@ -123,7 +123,7 @@ describe("bound system", function(){ }) // When - var action = system.getSystem().kyleActions.simple(1) + let action = system.getSystem().kyleActions.simple(1) expect(action).toEqual({ type: "simple", firstWrap: true, @@ -178,7 +178,7 @@ describe("bound system", function(){ }) // When - var action = system.getSystem().kyleActions.simple(1) + let action = system.getSystem().kyleActions.simple(1) expect(action.type).toEqual("one-two-three") }) @@ -257,7 +257,7 @@ describe("bound system", function(){ }) // When - var action = system.getSystem().kyleActions.simple(1) + let action = system.getSystem().kyleActions.simple(1) expect(action.type).toEqual("called") }) @@ -307,7 +307,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().joshSelectors.simple(1) + let res = system.getSystem().joshSelectors.simple(1) expect(res).toEqual({ state: fromJS({ one: 1 @@ -340,7 +340,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().joshSelectors.advanced(1) + let res = system.getSystem().joshSelectors.advanced(1) expect(res).toEqual("hi") }) @@ -380,7 +380,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().dogeSelectors.wow(1) + let res = system.getSystem().dogeSelectors.wow(1) expect(res).toEqual("original wrapper") }) @@ -479,7 +479,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("test") + let Component = system.getSystem().getComponent("test") const renderedComponent = render() expect(renderedComponent.text()).toEqual("Test component") }) @@ -525,7 +525,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("ContainerComponent", true) + let Component = system.getSystem().getComponent("ContainerComponent", true) const renderedComponent = render( @@ -578,7 +578,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("ContainerComponent", true) + let Component = system.getSystem().getComponent("ContainerComponent", true) const renderedComponent = render( @@ -613,7 +613,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().wow() + let res = system.getSystem().wow() expect(res).toEqual("so selective") }) it("should call a preset plugin's `afterLoad` method after the plugin is loaded", function() { @@ -640,7 +640,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().wow() + let res = system.getSystem().wow() expect(res).toEqual("so selective") }) it("should call a function preset plugin's `afterLoad` method after the plugin is loaded", function() { @@ -669,7 +669,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().wow() + let res = system.getSystem().wow() expect(res).toEqual("so selective") }) it("should call a registered plugin's `afterLoad` method after the plugin is loaded", function() { @@ -696,7 +696,7 @@ describe("bound system", function(){ system.register([MyPlugin]) // When - var res = system.getSystem().wow() + let res = system.getSystem().wow() expect(res).toEqual("so selective") }) }) @@ -726,7 +726,7 @@ describe("bound system", function(){ }) // When - var res = system.getSystem().wow() + let res = system.getSystem().wow() expect(res).toEqual("so selective") }) }) @@ -757,7 +757,7 @@ describe("bound system", function(){ // When expect(function() { system.register([ThrowyPlugin]) - // var resSystem = system.getSystem() + // let resSystem = system.getSystem() }).toNotThrow() }) @@ -934,7 +934,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("BrokenComponent") + let Component = system.getSystem().getComponent("BrokenComponent") const renderedComponent = render() // Then @@ -962,7 +962,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("BrokenComponent") + let Component = system.getSystem().getComponent("BrokenComponent") const renderedComponent = render() // Then @@ -985,7 +985,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("BrokenComponent") + let Component = system.getSystem().getComponent("BrokenComponent") const renderedComponent = render() // Then @@ -1013,7 +1013,7 @@ describe("bound system", function(){ }) // When - var Component = system.getSystem().getComponent("BrokenComponent", true) + let Component = system.getSystem().getComponent("BrokenComponent", true) const renderedComponent = render( diff --git a/test/mocha/core/system/wrapComponent.jsx b/test/mocha/core/system/wrapComponent.jsx index 47257081..f051a819 100644 --- a/test/mocha/core/system/wrapComponent.jsx +++ b/test/mocha/core/system/wrapComponent.jsx @@ -28,7 +28,7 @@ describe("wrapComponents", () => { }) // When - var Component = system.getSystem().getComponents("wow") + let Component = system.getSystem().getComponents("wow") const wrapper = render() const container = wrapper.children().first() @@ -73,7 +73,7 @@ describe("wrapComponents", () => { }) // When - var Component = system.getSystem().getComponents("wow") + let Component = system.getSystem().getComponents("wow") const wrapper = render() const container = wrapper.children().first() @@ -125,7 +125,7 @@ describe("wrapComponents", () => { }) // Then - var Component = mySystem.getSystem().getComponents("wow") + let Component = mySystem.getSystem().getComponents("wow") const wrapper = render() const container = wrapper.children().first() @@ -179,7 +179,7 @@ describe("wrapComponents", () => { ]) // Then - var Component = mySystem.getSystem().getComponents("wow") + let Component = mySystem.getSystem().getComponents("wow") const wrapper = render() const container = wrapper.children().first() @@ -233,7 +233,7 @@ describe("wrapComponents", () => { }) // Then - var Component = secondSystem.getSystem().getComponents("wow") + let Component = secondSystem.getSystem().getComponents("wow") const wrapper = render() const container = wrapper.children().first()