Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Switch to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb committed Jan 8, 2020
1 parent c7d6112 commit b9f6f2b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 22 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm test
env:
CI: true
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"lint": "eslint source/*.js && stylelint source/*.css",
"lint:fix": "eslint --fix source/*.js && stylelint --fix source/*.css",
"test": "npm run lint && cross-env BABEL_ENV=testing ava && run-s build",
"build": "webpack --mode=production",
"build": "webpack --mode=production -p",
"start": "webpack --mode=development --watch",
"release:amo": "shipit firefox distribution",
"release:cws": "shipit chrome distribution",
Expand Down
4 changes: 2 additions & 2 deletions source/libs/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const isEmpty = variable => (!variable || variable.length === 0 || Object.getOwnPropertyNames(variable).length === 0)

export const renderPlural = (data) => {
export const renderData = (data) => {
if (data.length < 1) {
return null
}
Expand All @@ -25,6 +25,6 @@ export const renderPlural = (data) => {
export const renderText = (data) => {
const text = document.createElement('p')
text.className = 'qui-possede-les-medias-text'
text.innerHTML = `Ce média appartient à ${renderPlural(data)}.`
text.innerHTML = `Ce média appartient à ${renderData(data)}.`
return text
}
1 change: 0 additions & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ test('renderData', t => {
t.true(renderedData.includes('<a href="link" rel="noopener noreferrer" target="_blank">name</a>'))
t.true(renderedData.includes('no link'))
t.false(renderedData.includes('rel="noopener noreferrer" target="_blank">no link</a>'))
t.false(renderedData.includes('no name'))
})

0 comments on commit b9f6f2b

Please sign in to comment.