Skip to content

Commit

Permalink
fix: tap
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Sep 4, 2024
1 parent 54961e1 commit b42f7c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"release": "run-s lint test build",
"lint": "eslint .",
"license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause;Apache-2.0\"",
"test": "TZ=UTC tap --node-arg=--experimental-json-modules --test-env=GITHUB_REPOSITORY=gitevents/ics-test test/*.test.js",
"test:report": "tap --test-env=GITHUB_REPOSITORY=gitevents/ics-test test/*.test.js --cov",
"test": "TZ=UTC GITHUB_REPOSITORY=gitevents/ics-test node --test",
"postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable"
Expand Down Expand Up @@ -77,8 +76,7 @@
"license-checker": "^25.0.1",
"npm-run-all": "^4.1.5",
"pinst": "^3.0.0",
"prettier": "^2.8.8",
"tap": "^18.8.0"
"prettier": "^2.8.8"
},
"release": {
"branches": [
Expand Down
20 changes: 9 additions & 11 deletions test/fetch-issues.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

import t from 'tap'
const test = t.test
import { test } from 'node:test'
import assert from 'node:assert'
import { fetchIssues as fn } from '../src/fetch-issues.js'
import ics from 'ics'

Expand Down Expand Up @@ -57,25 +56,24 @@ const response = {
}
}

test('fetchIssues() returns parsed issues/events', async (t) => {
test('fetchIssues() returns parsed issues/events', async () => {
const octokit = {
graphql: function () {
return response
}
}

const actual = await fn(octokit)
t.ok(actual)
console.log(actual)
assert.ok(actual)

const { error, value } = ics.createEvents(actual)
if (error) {
console.error(error)
t.fail(error)
assert.fail(error)
}
t.ok(value)
assert.ok(value)

const lines = value.split(/\n/g)
t.match(actual[0].start, [2022, 12, 11, 14, 0])
t.equal(lines[10].replace(/[\n\r]/g, ''), 'DTSTART:20221211T140000Z')
t.end()
assert.deepEqual(actual[0].start, [2022, 12, 11, 14, 0])
assert.equal(lines[10].replace(/[\n\r]/g, ''), 'DTSTART:20221211T140000Z')
})
8 changes: 0 additions & 8 deletions test/realworld.js

This file was deleted.

0 comments on commit b42f7c0

Please sign in to comment.