UNPKG

cache-storage

Version:

[ABANDONED] Advanced cache storage for node js

43 lines (35 loc) 1.02 kB
<html> <head> <title> Tests </title> <link rel="stylesheet" href="../../node_modules/mocha/mocha.css" /> </head> <body> <div id="mocha"></div> <script src="../../node_modules/mocha/mocha.js"></script> <script src="../../node_modules/chai/chai.js"></script> <script> mocha.ui('bdd'); mocha.reporter('html'); var expect = chai.expect; // helper for simulating files expiration window.changeFile = function(file) { var stats = window.require.getStats(file) var oldStats = {}; var newStats = {}; oldStats[file] = stats; newStats[window.require.resolve(file)] = { atime: stats.atime.getTime(), mtime: (new Date(stats.mtime.getTime())).setHours(stats.mtime.getHours() + 1), ctime: stats.ctime.getTime() }; window.require.__setStats(newStats); return oldStats; }; </script> <script src="application.js"></script> <script> if (window.mochaPhantomJS) { mochaPhantomJS.run(); } else { mocha.run(); } </script> </body> </html>