Skip to content

Commit 905e517

Browse files
committed
Test with github actions
1 parent df07bd7 commit 905e517

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Use Node.js 12.x
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: 12.x
14+
- name: npm install, build, and test
15+
run: |
16+
npm ci
17+
npm test
18+
env:
19+
CI: true

test/test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import subscribe from '../dist/index.esm.js'
22

33
describe('paste-markdown', function() {
4-
describe('with quotable selection', function() {
4+
describe('installed on textarea', function() {
55
let subscription, textarea
66
beforeEach(function() {
77
document.body.innerHTML = `
@@ -17,17 +17,12 @@ describe('paste-markdown', function() {
1717
document.body.innerHTML = ''
1818
})
1919

20-
it('pastes image uris as markdown', function() {
20+
it('turns image uris into markdown', function() {
2121
paste(textarea, {'text/uri-list': 'https://github.com/github.png\r\nhttps://github.com/hubot.png'})
2222
assert.include(textarea.value, '![](https://github.com/github.png)\n\n![](https://github.com/hubot.png)')
2323
})
2424

25-
it('pastes gfm into markdown', function() {
26-
paste(textarea, {'text/plain': 'hello', 'text/x-gfm': '# hello'})
27-
assert.include(textarea.value, '# hello')
28-
})
29-
30-
it('pastes html tables as markdown', function() {
25+
it('turns html tables into markdown', function() {
3126
const data = {
3227
'text/html': `
3328
<table>
@@ -43,7 +38,7 @@ describe('paste-markdown', function() {
4338
assert.include(textarea.value, 'name | origin\n-- | --\nhubot | github\nbender | futurama')
4439
})
4540

46-
it('does not paste excluded content as markdown', function() {
41+
it('rejects HTML from github.com markup', function() {
4742
const data = {
4843
'text/html': `
4944
<table class="js-comment">
@@ -58,6 +53,11 @@ describe('paste-markdown', function() {
5853
paste(textarea, data)
5954
assert.equal(textarea.value, '')
6055
})
56+
57+
it('accepts x-gfm', function() {
58+
paste(textarea, {'text/plain': 'hello', 'text/x-gfm': '# hello'})
59+
assert.include(textarea.value, '# hello')
60+
})
6161
})
6262
})
6363

0 commit comments

Comments
 (0)