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
Showing
10 changed files
with
74 additions
and
1 deletion.
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
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,2 @@ | ||
package-lock.json | ||
test*js |
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,4 @@ | ||
/* eslint-disable */ | ||
var sinon = require("sinon"); | ||
var sinonTestFactory = require("sinon-test"); | ||
var assert = require("assert"); |
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,20 @@ | ||
#!/bin/bash | ||
set -e; | ||
|
||
# make sure we can call this script from everywhere and still have relative paths working | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
pushd "$SCRIPT_DIR" > /dev/null | ||
|
||
# build test files | ||
cat esm-pre.mjs test-body.js > test.mjs | ||
cat cjs-pre.js test-body.js > test.js | ||
cat esm-bundle-pre.mjs test-body.js > test-bundle.mjs | ||
cat umd-bundle-pre.js test-body.js > test-bundle.js | ||
|
||
cd .. | ||
npm link # create a global symlink to the local sinon-test project | ||
cd "$SCRIPT_DIR" | ||
|
||
npm install | ||
npm link sinon-test # use local version | ||
npm test |
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,3 @@ | ||
import sinon from 'sinon'; | ||
import sinonTestFactory from 'sinon-test'; | ||
import assert from 'assert'; |
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,3 @@ | ||
import sinon from 'sinon'; | ||
import sinonTestFactory from 'sinon-test'; | ||
import assert from 'assert'; |
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,14 @@ | ||
{ | ||
"name": "test-integration", | ||
"version": "1.0.0", | ||
"description": "Tests the integration using other consumers", | ||
"dependencies": { | ||
"esm": "^3.0.82", | ||
"sinon-test": "^2.2.1" | ||
}, | ||
"scripts": { | ||
"test": "node -r esm test.mjs && node test.js && node -r esm test-bundle.mjs && node test-bundle.js" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
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,20 @@ | ||
/* eslint-disable */ | ||
var sinonTest = sinonTestFactory(sinon); | ||
|
||
var testFramework = { | ||
"the usual suspects should be present": sinonTest( | ||
function myTestFunction() { | ||
["stub", "spy", "mock"].forEach(function(func) { | ||
assert.equal(typeof this[func], "function"); | ||
}, this); | ||
["clock", "server"].forEach(function(name) { | ||
assert.equal(typeof this[name], "object"); | ||
}, this); | ||
} | ||
), | ||
"basic functionality should work": sinonTest(function myTestFunction() { | ||
assert.equal(this.stub().returns(42)(), 42); | ||
}) | ||
}; | ||
|
||
for (var test in testFramework) testFramework[test].call(testFramework); |
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,4 @@ | ||
/* eslint-disable */ | ||
var sinon = require("sinon"); | ||
var sinonTestFactory = require("sinon-test/dist/sinon-test"); | ||
var assert = require("assert"); |