-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83ef833
commit 598e617
Showing
6 changed files
with
73 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export function assertArrayEquals(expected, actual, testName = "Unknown Test") { | ||
if (!arraysEqual(expected, actual)) { | ||
throw new Error("Prepublish error for operations - Failed " + testName + | ||
" - . Expected " + expected + " , but != " + actual); | ||
} | ||
} | ||
|
||
export function assertEquals(expected, actual, testName = "Unknown Test") { | ||
if (expected !== actual) { | ||
throw new Error("Prepublish error for operations - Failed " + testName + | ||
" - . Expected " + expected + " , but != " + actual); | ||
} | ||
} | ||
|
||
export function assertTrue(test, testName = "Unknown Test") { | ||
if (!test) { | ||
throw new Error("Prepublish error for operations - Failed " + testName); | ||
} | ||
} | ||
|
||
export function assertFalse(test, testName = "Unknown Test") { | ||
if (test) { | ||
throw new Error("Prepublish error for operations - Failed " + testName); | ||
} | ||
} | ||
|
||
function arraysEqual(a, b) { | ||
if (a === b) return true; | ||
if (a == null || b == null) return false; | ||
if (a.length != b.length) return false; | ||
|
||
// If you don't care about the order of the elements inside | ||
// the array, you should sort both arrays here. | ||
|
||
for (var i = 0; i < a.length; ++i) { | ||
if (a[i] !== b[i]) return false; | ||
} | ||
return true; | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "integration-ts", | ||
"version": "1.0.0", | ||
"description": "used to test npm publications", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@masala/parser": "0.5.0" | ||
}, | ||
"devDependencies": { | ||
"ts-node": "^3.3.0", | ||
"typescript": "^2.5.3" | ||
}, | ||
"scripts": { | ||
"start": "ts-node ./working.ts", | ||
"test": "ts-node ./test.ts" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
Empty file.
This file contains 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