Skip to content

Commit

Permalink
Adding test to check that the svg files were downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Jan 30, 2019
1 parent f40bba7 commit 63e06f1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
24 changes: 22 additions & 2 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workflow "Octicons" {
on = "push"
resolves = [
"lint"
"test"
]
}

Expand All @@ -11,7 +11,27 @@ action "install" {
}

action "lint" {
needs = ["install"]
uses = "actions/npm@master"
args = "run lint"
}

action "test" {
needs = ["lint", "Figma Action"]
uses = "actions/npm@master"
args = "test"
}

action "Figma Action" {
needs = ["install"]
uses = "primer/figma-action@master"
secrets = [
"FIGMA_TOKEN"
]
env = {
"FIGMA_FILE_URL" = "https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons"
}
args = [
"format=svg",
"dir=./lib/build"
]
}
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"test": "ava tests/*.js",
"lint": "eslint tests"
},
"figma": {
"url": "https://www.figma.com/file/FP7lqd1V00LUaT5zvdklkkZr/Octicons"
},
"dependencies": {
"ava": "^0.22.0",
"eslint": "^5.8.0",
Expand Down
5 changes: 5 additions & 0 deletions tests/test-for-current-year.js → tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const globby = require('globby')

const year = new Date().getFullYear()
const yearRegex = new RegExp(`Copyright \\(c\\) ${year} GitHub Inc\\.`)
const octiconsLib = fs.readdirSync('./lib/build/svg')

test(`LICENSE files have the current year ${year}`, t => {
return globby(['**/LICENSE', '!**/node_modules/**/LICENSE', '!**/vendor/**/LICENSE']).then(paths => {
Expand All @@ -14,3 +15,7 @@ test(`LICENSE files have the current year ${year}`, t => {
})
})
})

test('SVG icons exist', t => {
t.not(octiconsLib.length, 0, `We didn't find any svg files`)
})

0 comments on commit 63e06f1

Please sign in to comment.