This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| // use this file except in compliance with the License. You may obtain a copy of | |
| // the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
| // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
| // License for the specific language governing permissions and limitations under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Convert(number, fromUnit) { | |
| console.log('Starting....'); | |
| var conversions = { | |
| distance: { | |
| meters: 1, | |
| cm: 0.01, | |
| feet: 0.3048, | |
| inches: 0.0254, | |
| yards: 0.9144 | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //define store configuration test suites | |
| describe('TestSuite-StoreConfig', function () { | |
| var storConfig = require('../../config/store.json'); | |
| //configuration data for helping to test | |
| var testConfig = { | |
| "assetsUrlPrefix": "/assets", | |
| "extensionsUrlPrefix": "/extensions", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //define test suites | |
| describe('TestSuite-JaggeryTestFramework', function () { | |
| it("is defined", function () { | |
| var name = "Andrew"; | |
| expect(name).toBeDefined(); | |
| }) | |
| it("is not defined", function () { | |
| var name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Bank() {}; | |
| Bank.send = function (information){ | |
| $.ajax({ | |
| method: "POST", | |
| url: "/data", | |
| data: information | |
| }); | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Bank() {}; | |
| Bank.send = function (information){ | |
| $.ajax({ | |
| method: "POST", | |
| url: "/data", | |
| data: information | |
| }); | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sendRequest(callbacks, configuration) { | |
| $.ajax({ | |
| url: configuration.url, | |
| dataType: "json", | |
| success: function(data) { | |
| callbacks.checkForInformation(data); | |
| }, | |
| error: function(data) { | |
| callbacks.displayErrorMessage(); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Test Suite One', function() { | |
| it('first Test', function() { | |
| expect("Hello world!").toEqual("Hello world!"); | |
| }); | |
| it('second Test', function() { | |
| expect(1).toBe(1); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Car(config) { | |
| this.name = config.name; | |
| this.engineSize = config.engineSize; | |
| this.toString = function () { | |
| return this.name + " has engine of " + this.engineSize + "cc"; | |
| }; | |
| this.start = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //1 way | |
| //setter | |
| newObject.someKey = "some value"; | |
| //getter | |
| var key = newObject.someKey; | |
| //2nd way | |
| // Set properties | |
| newObject["someKey"] = "some value"; | |
| // Get properties |