fix(tests): web broken tests

This commit is contained in:
lowlighter
2022-01-27 20:08:09 -05:00
parent d13677280d
commit 65aeac2954
9 changed files with 13 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
- uses: lowlighter/metrics@latest - uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_nightscout: 'yes' plugin_nightscout: 'yes'
plugin_nightscout_url: https://testapp.herokuapp.com/ plugin_nightscout_url: https://testapp.herokuapp.com/
use_mocked_data: 'yes' use_mocked_data: 'yes'

View File

@@ -1,6 +1,7 @@
- uses: lowlighter/metrics@latest - uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_poopmap_token: MOCKED_TOKEN
plugin_poopmap: 'yes' plugin_poopmap: 'yes'
use_mocked_data: 'yes' use_mocked_data: 'yes'
verify: 'yes' verify: 'yes'

View File

@@ -1,7 +1,7 @@
- name: ✒️ Recent posts - Recent posts - name: ✒️ Recent posts - Recent posts
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_posts: 'yes' plugin_posts: 'yes'
plugin_posts_source: dev.to plugin_posts_source: dev.to
use_mocked_data: 'yes' use_mocked_data: 'yes'
@@ -9,7 +9,7 @@
- name: ✒️ Recent posts - Recent posts with descriptions and cover images - name: ✒️ Recent posts - Recent posts with descriptions and cover images
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_posts: 'yes' plugin_posts: 'yes'
plugin_posts_source: dev.to plugin_posts_source: dev.to
plugin_posts_limit: 2 plugin_posts_limit: 2

View File

@@ -1,7 +1,7 @@
- name: 📸 Website screenshot - XKCD of the day - name: 📸 Website screenshot - XKCD of the day
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_screenshot: 'yes' plugin_screenshot: 'yes'
plugin_screenshot_title: XKCD of the day plugin_screenshot_title: XKCD of the day
plugin_screenshot_url: https://xkcd.com plugin_screenshot_url: https://xkcd.com

View File

@@ -1,7 +1,7 @@
- name: 🗨️ StackOverflow plugin - Top answers from stackoverflow - name: 🗨️ StackOverflow plugin - Top answers from stackoverflow
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_stackoverflow: 'yes' plugin_stackoverflow: 'yes'
plugin_stackoverflow_user: 1 plugin_stackoverflow_user: 1
plugin_stackoverflow_sections: answers-top plugin_stackoverflow_sections: answers-top

View File

@@ -1,7 +1,7 @@
- name: 💫 Starlists - Featured star list - name: 💫 Starlists - Featured star list
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_starlists: 'yes' plugin_starlists: 'yes'
plugin_starlists_limit_repositories: 2 plugin_starlists_limit_repositories: 2
plugin_starlists_only: TC39 plugin_starlists_only: TC39

View File

@@ -1,7 +1,7 @@
- name: 📌 Starred topics - Labels - name: 📌 Starred topics - Labels
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_topics: 'yes' plugin_topics: 'yes'
plugin_topics_limit: 12 plugin_topics_limit: 12
use_mocked_data: 'yes' use_mocked_data: 'yes'
@@ -9,7 +9,7 @@
- name: 📌 Starred topics - Icons - name: 📌 Starred topics - Icons
uses: lowlighter/metrics@latest uses: lowlighter/metrics@latest
with: with:
token: MOCKED_TOKEN token: NOT_NEEDED
plugin_topics: 'yes' plugin_topics: 'yes'
plugin_topics_limit: 0 plugin_topics_limit: 0
plugin_topics_mode: icons plugin_topics_mode: icons

View File

@@ -1,7 +1,7 @@
/**Mocked data */ /**Mocked data */
export default function({ faker, url, options, login = faker.internet.userName() }) { export default function({ faker, url, options, login = faker.internet.userName() }) {
//Wakatime api //Wakatime api
if (/^https:..api.poopmap.net$/.test(url)) { if (/^https:..api.poopmap.net/.test(url)) {
//Get user profile //Get user profile
if (/public_links\/MOCKED_TOKEN/.test(url)) { if (/public_links\/MOCKED_TOKEN/.test(url)) {
console.debug(`metrics/compute/mocks > mocking poopmap api result > ${url}`) console.debug(`metrics/compute/mocks > mocking poopmap api result > ${url}`)

View File

@@ -8,5 +8,6 @@
"NIGHTSCOUT_URL":"https://testapp.herokuapp.com/", "NIGHTSCOUT_URL":"https://testapp.herokuapp.com/",
"WAKATIME_TOKEN":"MOCKED_TOKEN", "WAKATIME_TOKEN":"MOCKED_TOKEN",
"TWITTER_TOKEN":"MOCKED_TOKEN", "TWITTER_TOKEN":"MOCKED_TOKEN",
"STOCK_TOKEN":"MOCKED_TOKEN" "STOCK_TOKEN":"MOCKED_TOKEN",
"POOPMAP_TOKEN":"MOCKED_TOKEN"
} }