Feat: improving ci (#16)

This commit also swaps in yarn for npm and tweaks circle ci a bit.

* appveyor.yml first go

* changing node

* ps

* narrow it down

* trying this

* fix airbnb module

* trying with yarn

* logging

* hybrid?

* trying yarn w/circle

* bump workers?

* build off?

* updating script

* tweaking script for appveyor

* bumping maxworkers

* cleaning up

* build step?

* yarn it

* added appveyor badge
pull/17/head
Adam Pash 8 years ago committed by GitHub
parent 071218ab3c
commit e325d860fd

@ -1,6 +1,6 @@
# Mercury Parser - Extracting content from chaos
[![CircleCI](https://circleci.com/gh/postlight/mercury-parser.svg?style=svg&circle-token=3026c2b527d3767750e767872d08991aeb4f8f10)](https://circleci.com/gh/postlight/mercury-parser)
[![CircleCI](https://circleci.com/gh/postlight/mercury-parser.svg?style=svg&circle-token=3026c2b527d3767750e767872d08991aeb4f8f10)](https://circleci.com/gh/postlight/mercury-parser) [![Build status](https://ci.appveyor.com/api/projects/status/bxwqp6mn8ijycqh4?svg=true)](https://ci.appveyor.com/project/adampash/mercury-parser)
The Mercury Parser extracts the bits that humans care about from any URL you give it. That includes article content, titles, authors, published dates, excerpts, lead images, and more.

@ -0,0 +1,14 @@
# scripts that run after cloning repository
install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node 4.3.2
# install modules
- npm install --global yarn
- yarn
build_script:
- yarn build
# to run your custom scripts instead of automatic tests
test_script:
- yarn test -- --maxWorkers=4

@ -1,5 +1,7 @@
## Customize the test machine
machine:
pre:
- mkdir ~/.yarn-cache
timezone:
America/New_York
@ -11,15 +13,20 @@ machine:
## Customize dependencies
dependencies:
pre:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- nvm install 6.9.1
- nvm install 7.0.0
cache_directories:
- ~/.yarn-cache
override:
- yarn install
## Customize test commands
test:
override:
- nvm use 4.3.2 && npm run build && jest --maxWorkers=1:
- nvm use 4.3.2 && yarn build && yarn test -- --maxWorkers=4:
parallel: true
- nvm use 6.9 && npm run build && jest --maxWorkers=1:
- nvm use 6.9 && yarn build && yarn test -- --maxWorkers=4:
parallel: true
- nvm use 7.0 && npm run build && jest --maxWorkers=1:
- nvm use 7.0 && yarn build && yarn test -- --maxWorkers=4:
parallel: true

@ -5,9 +5,9 @@
"repository": "github:postlight/mercury-parser",
"main": "./dist/mercury.js",
"scripts": {
"lint": "eslint src/** --fix",
"lint": "eslint src/**/*.js --fix",
"lint-fix-quiet": "eslint --fix --quiet",
"build": "eslint src/** --fix && rollup -c",
"build": "yarn lint && rollup -c",
"build-generator": "rollup -c scripts/rollup.config.js",
"test_build": "rollup -c",
"test": "jest",
@ -20,8 +20,8 @@
"license": "ISC",
"devDependencies": {
"all-contributors-cli": "^3.0.7",
"babel-eslint": "^6.1.2",
"babel-jest": "^15.0.0",
"babel-eslint": "^7.1.0",
"babel-jest": "^16.0.0",
"babel-plugin-external-helpers": "^6.8.0",
"babel-plugin-module-alias": "^1.6.0",
"babel-plugin-module-resolver": "^2.2.0",
@ -29,31 +29,32 @@
"babel-plugin-transform-es2015-destructuring": "^6.9.0",
"babel-plugin-transform-export-extensions": "^6.8.0",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-plugin-transform-runtime": "6.12.0",
"babel-plugin-transform-runtime": "6.15.0",
"babel-preset-es2015": "^6.13.2",
"babel-preset-es2015-rollup": "^1.2.0",
"babel-register": "^6.11.6",
"babelrc-rollup": "^3.0.0",
"eslint": "^3.5.0",
"eslint-config-airbnb": "^11.1.0",
"eslint": "^3.8.1",
"eslint-config-airbnb": "^12.0.0",
"eslint-import-resolver-babel-module": "^2.0.1",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-jsx-a11y": "^2.2.2",
"eslint-plugin-react": "^6.2.1",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.4.1",
"inquirer": "^1.1.3",
"jest": "^15.1.1",
"jest": "^16.0.2",
"jest-cli": "^16.0.2",
"mocha": "^3.0.2",
"ora": "^0.3.0",
"rollup": "^0.34.13",
"rollup": "^0.36.3",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-commonjs": "^4.1.0",
"rollup-plugin-commonjs": "^5.0.5",
"rollup-plugin-multi-entry": "^2.0.1"
},
"dependencies": {
"babel-polyfill": "^6.13.0",
"babel-runtime": "^6.11.6",
"cheerio": "^0.20.0",
"cheerio": "^0.22.0",
"difflib": "^0.2.4",
"ellipsize": "0.0.2",
"moment": "^2.14.1",

@ -5,19 +5,19 @@ import Mercury from './mercury';
describe('Mercury', () => {
describe('parse(url)', () => {
it('returns an error if a malformed url is passed', async function() {
it('returns an error if a malformed url is passed', async () => {
const error = await Mercury.parse('foo.com');
assert.equal(error, Errors.badUrl);
});
it('returns an error if a bad url is passed', async function() {
it('returns an error if a bad url is passed', async () => {
const error = await Mercury.parse('foo.com');
assert.equal(error, Errors.badUrl);
});
it('does the whole thing', async function() {
it('does the whole thing', async () => {
const result =
await Mercury.parse('http://deadspin.com/remember-when-donald-trump-got-booed-for-butchering-ta-1788216229');
@ -25,33 +25,33 @@ describe('Mercury', () => {
assert.equal(result.content.indexOf('score="') === -1, true);
});
it('does blogger', async function() {
it('does blogger', async () => {
const result =
await Mercury.parse('https://googleblog.blogspot.com/2016/08/onhub-turns-one-today.html');
assert.equal(typeof result, 'object');
});
it('does blogger', async function() {
it('does blogger', async () => {
const result = await Mercury.parse('https://googleblog.blogspot.com/2016/08/onhub-turns-one-today.html');
assert.equal(typeof result, 'object');
});
it('does wikipedia', async function() {
it('does wikipedia', async () => {
const result = await Mercury.parse('https://en.wikipedia.org/wiki/Brihadeeswarar_Temple_fire');
assert.equal(typeof result, 'object');
});
it('does the nyt', async function() {
it('does the nyt', async () => {
const result = await Mercury.parse('http://www.nytimes.com/2016/08/16/upshot/the-state-of-the-clinton-trump-race-is-it-over.html?_r=0');
assert.equal(typeof result, 'object');
assert.equal(result.total_pages, 1);
});
it('does ars pagination', async function() {
it('does ars pagination', async () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
const url = 'http://arstechnica.com/gadgets/2016/08/the-connected-renter-how-to-make-your-apartment-smarter/';
const result = await Mercury.parse(

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save