-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move everything into docs/ in prep for moving repo into mocha proper
- some jekyll tweaks were needed; we can no longer consume the `github-pages` gem apparently since they added support for themes - added `markdown-toc` dev dep to build the toc - added `buildDocs` and `serveDocs` scripts - miraculously avoided monkeying with the content itself Signed-off-by: Christopher Hiller <[email protected]>
- Loading branch information
Showing
54 changed files
with
117 additions
and
6,065 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
env: | ||
browser: true | ||
node: false |
File renamed without changes.
File renamed without changes.
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,33 @@ | ||
# mochajs.org | ||
|
||
*So you wanna build the site?* | ||
|
||
[mochajs.org](https://mochajs.org) is built using [Jekyll](http://jekyllrb.com), the popular static site generator. | ||
|
||
## Prerequisites | ||
|
||
- Ruby | ||
- RubyGems | ||
- Bundler (`gem install bundler`) | ||
- Node.js v4.0.0 or greater | ||
|
||
## Development | ||
|
||
1. Run `npm install` to get Node.js deps. | ||
2. Run `bundle install` to install Jekyll and its dependencies. This may or may not require elevated privileges, depending on your system. | ||
3. To serve the site and rebuild as changes are made, execute `npm run serveDocs`. | ||
4. To rebuild the site *once*, execute `npm start buildDocs`. | ||
|
||
### Notes | ||
|
||
- The content lives in `docs/index.md`; everything else is markup, scripts, assets, etc. | ||
- `docs/index.md` may be mutated upon build. If you update the table of contents, **you must commit `index.md`**; GitHub won't do it for you. | ||
- `docs/_site/` is where the generated static site lives (and is what you see at [mochajs.org](https://mochajs.org)). It is *not* under version control. | ||
|
||
## License | ||
|
||
:copyright: 2016-2017 [JS Foundation](https://js.foundation) and contributors. | ||
|
||
Content licensed [CC-BY-4.0](https://raw.githubusercontent.com/mochajs/mocha/master/docs/LICENSE-CC-BY-4.0). | ||
|
||
Code licensed [MIT](https://raw.githubusercontent.com/mochajs/mocha/master/LICENSE-MIT). |
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,8 @@ | ||
url: https://mochajs.org | ||
exclude: | ||
- README.md | ||
- .* | ||
- LICENSE* | ||
repository: mochajs/mocha | ||
source: docs | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,33 @@ | ||
'use strict'; | ||
|
||
const {createHook} = require('async_hooks'); | ||
const {stackTraceFilter} = require('mocha/lib/utils'); | ||
const allResources = new Map(); | ||
const resourceActivity = new Set(); | ||
|
||
const filterStack = stackTraceFilter(); | ||
|
||
const hook = createHook({ | ||
init(asyncId, type, triggerAsyncId) { | ||
allResources.set(asyncId, {type, triggerAsyncId, stack: (new Error()).stack}); | ||
}, | ||
before(asyncId) { | ||
resourceActivity.add(asyncId); | ||
}, | ||
after(asyncId) { | ||
resourceActivity.delete(asyncId); | ||
}, | ||
destroy(asyncId) { | ||
allResources.delete(asyncId); | ||
} | ||
}).enable(); | ||
|
||
global.asyncDump = module.exports = () => { | ||
hook.disable(); | ||
console.error('STUFF STILL IN THE EVENT LOOP:') | ||
allResources.forEach(value=> { | ||
console.error(`Type: ${value.type}`); | ||
console.error(filterStack(value.stack)); | ||
console.error('\n'); | ||
}); | ||
}; |
File renamed without changes.
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,22 @@ | ||
'use strict'; | ||
|
||
const net = require('net'); | ||
const assert = require('assert'); | ||
|
||
describe('how to debug Mocha when it hangs', function () { | ||
before(function (done) { | ||
const server = net.createServer(); | ||
server.listen(10101, done); | ||
}); | ||
|
||
after(function () { | ||
global.asyncDump(); | ||
}); | ||
|
||
it('should complete, but Mocha should not exit', function(done) { | ||
const sock = net.createConnection(10101, () => { | ||
assert.deepEqual(sock.address().family, 'IPv4'); | ||
done(); | ||
}); | ||
}); | ||
}); |
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
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
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,15 @@ | ||
(function () { | ||
'use strict'; | ||
// dumb thing that helps with animation of avatars | ||
var avatars = window.avatars = function (type) { | ||
return function avatarLoaded () { | ||
avatars[type] = typeof avatars[type] === 'number' ? avatars[type] + 1 : 1; | ||
if (avatars[type] === 30) { | ||
document.getElementById(type).classList.add('onload'); | ||
} | ||
}; | ||
}; | ||
|
||
avatars.backerLoaded = avatars('_backers'); | ||
avatars.sponsorLoaded = avatars('_sponsors'); | ||
}()); |
File renamed without changes.
Oops, something went wrong.