Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/modernize'
Browse files Browse the repository at this point in the history
  • Loading branch information
pirxpilot committed Apr 18, 2024
2 parents e4e5bfd + 0340822 commit 17a83d4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: yarn install
Expand Down
1 change: 0 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"eqnull": true,
"immed": true,
"latedef": "nofunc",
"mocha" : true,
"newcap": true,
"noarg": true,
"node": true,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ lint:
./node_modules/.bin/jshint *.js lib test

test:
./node_modules/.bin/mocha --recursive --require should
node --require should --test

.PHONY: check lint test
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MIT © [code42day](https://code42day.com)
[npm-image]: https://img.shields.io/npm/v/@furkot/export-ical
[npm-url]: https://npmjs.org/package/@furkot/export-ical

[build-image]: https://img.shields.io/github/workflow/status/furkot/export-ical/check
[build-image]: https://img.shields.io/github/actions/workflow/status/furkot/export-ical/check.yaml?branch=main
[build-url]: https://github.com/furkot/export-ical/actions/workflows/check.yaml

[deps-image]: https://img.shields.io/librariesio/release/npm/@furkot/export-ical
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"email": "pirxpilot@code42day.com",
"url": "https://code42day.com"
},
"repository": "furkot/export-ical",
"repository": {
"type": "git",
"url": "git+https://github.com/furkot/export-ical.git"
},
"license": "MIT",
"keywords": [
"furkot-ical",
Expand All @@ -20,11 +23,10 @@
"iCal"
],
"dependencies": {
"uuid": "^8.3.2"
"uuid": "~9"
},
"devDependencies": {
"jshint": "~2",
"mocha": "~10",
"@pirxpilot/jshint": "~3",
"should": "~13"
},
"scripts": {
Expand All @@ -34,4 +36,4 @@
"index.js",
"lib"
]
}
}
7 changes: 4 additions & 3 deletions test/ical.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { describe, it } = require('node:test');
const ical = require('../');

const fs = require('fs');
Expand Down Expand Up @@ -25,7 +26,7 @@ function compareLines(actual, expected) {
actual = actual.split('\r\n').filter(notStamp);
expected = expected.split('\r\n').filter(notStamp);

for(let i = 0; i < actual.length; i += 1) {
for (let i = 0; i < actual.length; i += 1) {
actual[i].should.eql(expected[i], `line: ${i}`);
}

Expand All @@ -35,15 +36,15 @@ function compareLines(actual, expected) {

describe('ical', function () {

it('simple trip', function() {
it('simple trip', function () {
const t = require('./fixtures/simple-trip.json');
const generated = ical(t);
const expected = readFileSync('fixtures/simple.ics');

compareLines(generated, expected);
});

it('multi trip', function() {
it('multi trip', function () {
const t = require('./fixtures/multi-trip.json');
const generated = ical(t);
const expected = readFileSync('fixtures/multi.ics');
Expand Down
11 changes: 6 additions & 5 deletions test/property.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const { describe, it } = require('node:test');
const property = require('../lib/property');

/* global TextDecoder */
const decoder = new TextDecoder();

describe('property', function () {

it('short', function() {
it('short', function () {
const p = property('abc', 'ąbć');

const { value, done } = p.next();
Expand All @@ -16,7 +17,7 @@ describe('property', function () {
p.next().done.should.equal(true);
});

it('long', function() {
it('long', function () {
const p = property('A', 'a'.repeat(100));

const values = Array.from(p);
Expand All @@ -30,7 +31,7 @@ describe('property', function () {
strings[1].should.equal(` ${'a'.repeat(27)}\r\n`);
});

it('very long', function() {
it('very long', function () {
const p = property('A', 'a'.repeat(300));

const strings = Array.from(p).map(s => decoder.decode(s));
Expand All @@ -43,7 +44,7 @@ describe('property', function () {
strings[4].should.equal(` ${'a'.repeat(5)}\r\n`);
});

it('long with multibyte', function() {
it('long with multibyte', function () {
const p = property('A', 'ą'.repeat(100));

const strings = Array.from(p).map(s => decoder.decode(s));
Expand All @@ -54,7 +55,7 @@ describe('property', function () {
strings[2].should.equal(` ${'ą'.repeat(100 - 37 - 36)}\r\n`);
});

it('long with emoji', function() {
it('long with emoji', function () {
const p = property('A', '🌻'.repeat(100));

const strings = Array.from(p).map(s => decoder.decode(s));
Expand Down

0 comments on commit 17a83d4

Please sign in to comment.