Skip to content
Open

init #1814

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm start & sleep 5 && npm test
- name: Upload tests report(cypress mochaawesome merged HTML report)
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: report
path: reports
19 changes: 16 additions & 3 deletions src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,20 @@ const people = [
},
];

// eslint-disable-next-line no-console
console.log(people); // you can remove it
const table = document.querySelector('.dashboard');

// write your code here
for (const person of people) {
const row = document.createElement('tr');
const age = person.died - person.born;
const century = Math.ceil(person.died / 100);
const gender = person.sex === 'm' ? 'Male' : 'Female';

[person.name, gender, person.born, person.died, age, century].forEach(value => {
const cell = document.createElement('td');

cell.textContent = value;
row.appendChild(cell);
});

table.appendChild(row);
}
Loading