Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 0 additions & 41 deletions .github/workflows/ci.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/update-notice-year.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .harness/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
pipeline:
name: javascript-commons
identifier: javascriptcommons
projectIdentifier: Harness_Split
orgIdentifier: PROD
tags: {}
properties:
ci:
codebase:
connectorRef: fmegithubharnessgitops
repoName: javascript-commons
build: <+input>
stages:
- stage:
name: Check-Test-Build
identifier: Checkout_code
description: ""
type: CI
spec:
cloneCodebase: true
caching:
enabled: true
override: true
paths: []
platform:
os: Linux
arch: Amd64
runtime:
type: Cloud
spec:
size: small
imageSpec:
imageName: ubuntu-latest
buildIntelligence:
enabled: false
execution:
steps:
- step:
type: Run
name: Install and run redis-server
identifier: redis_server
spec:
shell: Sh
command: |-
apt-get update && apt-get install -y redis-server
redis-server --daemonize yes
- step:
type: Action
name: Set up Node.js
identifier: Set_up_Nodejs
spec:
uses: dcodeIO/setup-node-nvm@master
with:
node-version: lts/*
- step:
type: Run
name: npm ci
identifier: npm_ci
spec:
shell: Sh
command: npm ci
- step:
type: Run
name: npm run check
identifier: npm_run_check
spec:
shell: Sh
command: npm run check
- step:
type: Run
name: npm run test
identifier: npm_run_test
spec:
shell: Sh
command: npm run test
- step:
type: Run
name: npm run build
identifier: npm_run_build
spec:
shell: Sh
command: npm run build
15 changes: 15 additions & 0 deletions .harness/input-set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
inputSet:
name: javascript-commons
tags: {}
identifier: javascriptcommons
orgIdentifier: PROD
projectIdentifier: Harness_Split
pipeline:
identifier: javascriptcommons
properties:
ci:
codebase:
build:
type: branch
spec:
branch: <+trigger.branch>
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
lts/*
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions src/__tests__/testUtils/csv.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import fs from 'fs';
import rl from 'readline';

export function readCSV(filePath: string, delimiter = ','): Promise<string[][]> {
return new Promise((resolve) => {
const parser = rl.createInterface({
input: fs.createReadStream(filePath)
});
return new Promise((resolve, reject) => {
fs.readFile(filePath, 'utf8', (err, content) => {
if (err) return reject(err);

const data: string[][] = [];
const lines = content.split(/\r?\n/);
const data = lines
.filter(line => line.trim().length > 0)
.map(line => line.split(delimiter));

parser
.on('line', line => {
data.push(line.split(delimiter));
})
.on('close', () => resolve(data));
resolve(data);
});
});
}