diff --git a/README.md b/README.md index 63a37f1..6fdc91b 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The whole [portfolio](https://matthiaskretschmann.com) is a React-based Single P ### ⛵️ Lighthouse score -[![Lighthouse scores](https://lighthouse.now.sh/?perf=100&pwa=100&a11y=100&bp=100&seo=100)](https://travis-ci.com/kremalicious/portfolio) +![Lighthouse scores](https://lighthouse.now.sh/?perf=100&pwa=100&a11y=100&bp=100&seo=100) ### 💍 One data file to rule all pages @@ -113,7 +113,7 @@ All SVG assets under `src/images/` will be converted to React components with th ```js import { ReactComponent as Logo } from './components/svg/Logo' - +return ``` ### 🍬 Typekit component @@ -167,7 +167,7 @@ Then continue modifying the new entry in [`data/projects.yml`](data/projects.yml Finally, add as many images as needed with the file name format and put into `src/images/`: -``` +```text portfolio-SLUG-01.png portfolio-SLUG-02.png portfolio-SLUG-03.png diff --git a/package.json b/package.json index c82a3f2..a125214 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dev": "./node_modules/gatsby/dist/bin/gatsby.js develop --host 0.0.0.0", "format": "prettier --write 'src/**/*.{js,jsx}'", "format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'", - "test": "npm run lint && ./node_modules/.bin/ava **/*.test.js --verbose", + "test": "npm run lint", "deploy": "./scripts/deploy.sh", "new": "babel-node ./scripts/new.js" }, @@ -56,19 +56,15 @@ "devDependencies": { "@babel/core": "^7.2.2", "@babel/node": "^7.2.2", - "@babel/polyfill": "^7.2.5", "@babel/preset-env": "^7.2.3", "@svgr/webpack": "^4.1.0", - "ava": "^1.1.0", "babel-eslint": "^10.0.1", - "chrome-launcher": "^0.10.5", "eslint": "^5.12.1", "eslint-config-prettier": "^3.6.0", "eslint-loader": "^2.1.1", "eslint-plugin-graphql": "^3.0.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.4", - "lighthouse": "^4.0.0", "ora": "^3.0.0", "prepend": "^1.0.2", "prettier": "^1.16.0", diff --git a/scripts/lighthouse.test.js b/scripts/lighthouse.test.js deleted file mode 100644 index ceca638..0000000 --- a/scripts/lighthouse.test.js +++ /dev/null @@ -1,56 +0,0 @@ -import '@babel/polyfill' -import * as chromeLauncher from 'chrome-launcher' -import test from 'ava' -import lighthouse from 'lighthouse' -import { siteMetadata } from '../gatsby-config' - -const launchChromeAndRunLighthouse = ( - url, - opts = { chromeFlags: ['--headless'] }, - config = null -) => - chromeLauncher - .launch({ chromeFlags: opts.chromeFlags }) - .then(async chrome => { - opts.port = chrome.port - const results = await lighthouse(url, opts, config) - await chrome.kill() - return results.lhr - }) - -let scores - -test.before(async () => { - console.log(`Auditing ${siteMetadata.siteUrl}.\n`) // eslint-disable-line no-console - scores = await launchChromeAndRunLighthouse(siteMetadata.siteUrl).then( - ({ categories }) => categories - ) -}) - -const logScore = score => `Is ${score * 100}.` - -const testOutput = (t, metric) => { - const { score } = scores[metric] - t.log(logScore(score)) - return score >= 0.9 ? t.pass() : t.fail() -} - -test('Performance Score above 90', t => { - testOutput(t, 'performance') -}) - -test('PWA Score above 90', t => { - testOutput(t, 'pwa') -}) - -test('Accessibility Score above 90', t => { - testOutput(t, 'accessibility') -}) - -test('Best Practices Score above 90', t => { - testOutput(t, 'best-practices') -}) - -test('SEO Score above 90', t => { - testOutput(t, 'seo') -})