Skip to content

Commit

Permalink
Merge 1ba25f0 into d714b8f
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Feb 13, 2022
2 parents d714b8f + 1ba25f0 commit 5ac1067
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 74 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

32 changes: 0 additions & 32 deletions .eslintrc

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,65 @@
name: Actions
on:
pull_request:
branches:
- master

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run linters
run: npm run lint
test:
name: Test
runs-on: ubuntu-latest
needs: lint
strategy:
max-parallel: 1
matrix:
node-version: [8.x, 12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
parallel: true
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
84 changes: 84 additions & 0 deletions .github/workflows/release.yaml
@@ -0,0 +1,84 @@
name: Release
on:
push:
branches:
- master

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Run linters
run: npm run lint
test:
name: Test
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
node-version: [8.x, 12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
parallel: true
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: [lint, test, coverage]
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
semantic_version: 17
branches: |
['master']
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -29,3 +29,5 @@ node_modules

# Distribution files
dist

.idea/
2 changes: 2 additions & 0 deletions .npmignore
Expand Up @@ -6,3 +6,5 @@
.nvmrc
content
test
.idea/
.github/
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
6.1.0
lts/gallium
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

66 changes: 64 additions & 2 deletions package.json
Expand Up @@ -8,8 +8,9 @@
"test": "test/**/*.spec.js"
},
"scripts": {
"test": "nyc mocha \"test/**/*.spec.js\" --exit",
"coverage": "npm test && nyc report --reporter=text-lcov | npx coveralls",
"test": "nyc mocha",
"coverage": "npm test && npm run cov:gen | npx coveralls",
"cov:gen": "nyc report --reporter=text-lcov",
"lint": "eslint src/ test/",
"lint:fix": "eslint src/ test/ --fix",
"prepublishOnly": "npm run build:types",
Expand Down Expand Up @@ -52,8 +53,13 @@
"request": "^2.88.2"
},
"nyc": {
"skip-full": true,
"all": true,
"instrument": true,
"reporter": [
"lcov",
"text"
],
"include": [
"src/**/*"
]
Expand All @@ -63,5 +69,61 @@
},
"release": {
"branch": "master"
},
"eslintIgnore": [
"**/*{.,-}min.js"
],
"eslintConfig": {
"extends": "airbnb-base",
"parserOptions": {
"sourceType": "script"
},
"rules": {
"valid-jsdoc": [
"error",
{
"requireReturn": false,
"requireReturnDescription": false,
"preferType": {
"String": "string",
"Number": "number",
"Boolean": "boolean",
"Function": "function",
"object": "Object",
"date": "Date",
"error": "Error"
},
"prefer": {
"return": "returns"
}
}
],
"strict": [
"error",
"safe"
],
"linebreak-style": "off",
"no-restricted-syntax": [
"off"
],
"no-await-in-loop": "off",
"import/no-unresolved": 0,
"no-param-reassign": 0,
"complexity": [
"error",
10
],
"arrow-parens": [
"error",
"always"
]
}
},
"mocha": {
"spec": "test/**/*.spec.js",
"exit": true,
"slow": 1000,
"normal": 400,
"reporter": "min"
}
}
7 changes: 4 additions & 3 deletions test/unit/rss-feed-emitter.spec.js
Expand Up @@ -15,7 +15,9 @@ const { expect } = chai;
let feeder;
const defaultUserAgent = 'Node/RssFeedEmitter (https://github.com/filipedeschamps/rss-feed-emitter)';

describe('RssFeedEmitter (unit)', () => {
describe('RssFeedEmitter (unit)', function unit() {
this.retries(8);

beforeEach(() => {
feeder = new RssFeedEmitter();
});
Expand Down Expand Up @@ -813,12 +815,11 @@ describe('RssFeedEmitter (unit)', () => {

const feed = new Feed({ url: 'https://www.nintendolife.com/feeds/latest', refresh: 100 });
let numHandled = 0;
const handler = {
feed.handler = {
handle: () => {
numHandled += 1;
},
};
feed.handler = handler;
await feed.fetchData();
expect(numHandled).to.eq(2);
});
Expand Down

0 comments on commit 5ac1067

Please sign in to comment.