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
language: bash | |
script: | |
- ./test.sh |
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
@test "Should show matching notes only if a pattern is provided to find" { | |
touch $NOTES_DIRECTORY/match-note1.md | |
touch $NOTES_DIRECTORY/hide-note2.md | |
run $notes find "match" | |
assert_success | |
assert_line "match-note1.md" | |
refute_line "hide-note2.md" | |
} |
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
git clone <your repo> | |
git submodule update --init --recursive | |
./test.sh |
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
# Run this file (with 'entr' installed) to watch all files and rerun tests on changes | |
ls -d **/* | entr ./test.sh |
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
# Run this file to run all the tests, once | |
./test/libs/bats/bin/bats test/*.bats |
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
#!./test/libs/bats/bin/bats | |
load 'libs/bats-support/load' | |
load 'libs/bats-assert/load' | |
@test "Should add numbers together" { | |
assert_equal $(echo 1+1 | bc) 2 | |
} |
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
mkdir -p test/libs | |
git submodule add https://github.com/sstephenson/bats test/libs/bats | |
git submodule add https://github.com/ztombol/bats-support test/libs/bats-support | |
git submodule add https://github.com/ztombol/bats-assert test/libs/bats-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
async function getThread(github: any, url: string): Promise<Thread> { | |
let issueMatch = /api.github.com\/repos\/([\-\w]+)\/([\-\w]+)\/issues\/(\d+)/.exec(url); | |
if (!issueMatch) { | |
throw new Error(`Received issue notification that didn't match regex: ${url}`); | |
} | |
let repo = new Repo(issueMatch[1], issueMatch[2]); | |
let id = parseInt(issueMatch[3], 10); | |
let comments = await github.issues.getComments({ |
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
class Thread { | |
constructor (private github: any, private url: string) /* : Promise<Thread> */ { | |
let issueMatch = /api.github.com\/repos\/([\-\w]+)\/([\-\w]+)\/issues\/(\d+)/.exec(url); | |
if (!issueMatch) { | |
throw new Error(`Received issue notification that didn't match regex: ${url}`); | |
} | |
this.repo = new Repo(issueMatch[1], issueMatch[2]); | |
this.id = parseInt(issueMatch[3], 10); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
div:not(:target) { | |
display: none; | |
} | |
div:target { | |
display: block; |