caccl-authorizer
Advanced tools
Comparing version 1.0.5 to 1.0.7
{ | ||
"name": "caccl-authorizer", | ||
"version": "1.0.5", | ||
"version": "1.0.7", | ||
"description": "Acquires Canvas tokens through via OAuth, stores refresh tokens, and refreshes access tokens when they expire.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node test" | ||
"test": "node test", | ||
"accept": "node test/accept" | ||
}, | ||
@@ -31,5 +32,5 @@ "repository": { | ||
"body-parser": "^1.18.3", | ||
"caccl": "^1.0.41", | ||
"caccl": "^1.0.42", | ||
"caccl-canvas-partial-simulator": "^1.0.9", | ||
"dce-selenium": "^1.0.12", | ||
"dce-selenium": "^1.0.14", | ||
"eslint": "^5.13.0", | ||
@@ -39,3 +40,3 @@ "eslint-config-airbnb": "^17.1.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-jsx-a11y": "^6.2.0", | ||
"eslint-plugin-jsx-a11y": "^6.2.1", | ||
"eslint-plugin-react": "^7.12.4", | ||
@@ -42,0 +43,0 @@ "express": "^4.16.4", |
@@ -1,4 +0,4 @@ | ||
const Mocha = require('mocha'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const runSelenium = require('dce-selenium/run'); | ||
@@ -13,11 +13,8 @@ const createAppCanvasPair = require('./helpers/createAppCanvasPair'); | ||
let numFailures = 0; | ||
let backupDescribe; | ||
const runTests = async (folderName) => { | ||
const folderNameParts = folderName.split('/'); | ||
console.log(`Running tests in ${folderNameParts[folderNameParts.length - 1]}`); | ||
console.log(`\n\nRunning tests in ${folderName}\n`); | ||
// Read configuration | ||
const configFilename = path.join(folderName, 'config.js'); | ||
const configFilename = path.join(__dirname, 'selenium', folderName, 'config.js'); | ||
/* eslint-disable global-require */ | ||
@@ -30,33 +27,6 @@ /* eslint-disable import/no-dynamic-require */ | ||
// Start Mocha tests | ||
// Instantiate a Mocha instance. | ||
const mocha = new Mocha({ | ||
reporter: 'spec', | ||
// Start tests | ||
await runSelenium({ | ||
subfolder: folderName, | ||
}); | ||
// Add each .js file to the mocha instance | ||
fs.readdirSync(folderName).filter((file) => { | ||
// Skip config.js | ||
if (file === 'config.js') { | ||
return false; | ||
} | ||
// Only keep the .js files | ||
return (file.substr(-3) === '.js'); | ||
}) | ||
.forEach((file) => { | ||
mocha.addFile( | ||
path.join(folderName, file) | ||
); | ||
}); | ||
// Run the tests | ||
await new Promise((resolve) => { | ||
mocha.run((failures) => { | ||
numFailures += failures; | ||
if (!backupDescribe) { | ||
backupDescribe = global.describe; | ||
} | ||
resolve(); | ||
}); | ||
}); | ||
}; | ||
@@ -70,8 +40,7 @@ | ||
return fs.readdirSync(location) | ||
.map((name) => { | ||
return path.join(location, name); | ||
}) | ||
.filter(isDirectory); | ||
.filter((folder) => { | ||
return isDirectory(path.join(location, folder)); | ||
}); | ||
}; | ||
const dirs = listDirectories(path.join(__dirname, 'selenium-tests')); | ||
const dirs = listDirectories(path.join(__dirname, 'selenium')); | ||
const runAllTests = async () => { | ||
@@ -82,11 +51,4 @@ /* eslint-disable no-await-in-loop */ | ||
} | ||
// Print out number of failures | ||
if (numFailures === 0) { | ||
console.log('\nAll tests passed!'); | ||
} else { | ||
console.log('\n' + '!'.repeat(10) + ' Notice: ' + '!'.repeat(10)); | ||
console.log('\nSome tests failed!\nScroll back up through the many Mocha reports (each folder in test/selenium-tests runs separately) and find the errors.\n'); | ||
} | ||
process.exit(0); | ||
}; | ||
runAllTests(); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
76449
1715