Skip to content

Instantly share code, notes, and snippets.

@shannonmoeller
Last active December 2, 2022 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shannonmoeller/2f681af7fd5676dda74f56c6a14dee76 to your computer and use it in GitHub Desktop.
Save shannonmoeller/2f681af7fd5676dda74f56c6a14dee76 to your computer and use it in GitHub Desktop.
# Module Starter
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
.nyc_output/
coverage/
node_modules/
*.log
.*.swp
.npmignore
export default 'TODO';
{
"name": "TODO",
"version": "0.0.0",
"description": "TODO",
"scripts": {
"lint": "npx eslint --fix \"**/*.js\" && npx prettier --write \"**/*.js\" && npx -p typescript tsc",
"test": "node test.js",
"cover": "npx c8 npm test"
},
"keywords": [],
"author": "Shannon Moeller <me@shannonmoeller> (http://shannonmoeller.com)",
"homepage": "https://github.com/shannonmoeller/TODO#readme",
"repository": "https://github.com/shannonmoeller/TODO.git",
"license": "MIT",
"type": "module",
"main": "index.js",
"files": ["*.js"],
"dependencies": {},
"devDependencies": {},
"engines": {
"node": ">= 14"
},
"eslintConfig": {
"extends": "eslint:recommended",
"env": {
"node": true
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
}
},
"prettier": {
"singleQuote": true
}
}
import assert from 'node:assert';
import todo from './index.js';
const tests = [];
function test(msg, fn) {
tests.push([msg, fn]);
}
process.nextTick(async function run() {
for (const [msg, fn] of tests) {
try {
await fn(assert);
console.log(`pass - ${msg}`);
} catch (error) {
console.error(`fail - ${msg}`, error);
process.exitCode = 1;
}
}
});
test('TODO', async () => {
assert.equal(todo, 'TODO');
});
{
"include": ["**/*.js"],
"exclude": ["node_modules"],
"compilerOptions": {
"target": "ESNEXT",
"allowJs": true,
"checkJs": true,
"noEmit": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment