Skip to content
This repository has been archived by the owner on Jul 3, 2022. It is now read-only.

Commit

Permalink
feat: add pr test (#128)
Browse files Browse the repository at this point in the history
* feat: add pr test

* fix: build issue
  • Loading branch information
bartosz-lipinski authored May 10, 2021
1 parent b463b30 commit 8bda197
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Build

on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn
- run: yarn test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/node": "^15.0.2",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",
Expand Down
11 changes: 11 additions & 0 deletions src/lib/tokenlist.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import fs from 'fs';

import test from 'ava';

import { CLUSTER_SLUGS, ENV, Strategy, TokenListProvider } from './tokenlist';
Expand Down Expand Up @@ -46,3 +48,12 @@ test('Token list throws error when calling filterByClusterSlug with slug that do
`Unknown slug: whoop, please use one of ${Object.keys(CLUSTER_SLUGS)}`
);
});

test('Token list ris a valid json', async (t) => {
t.notThrows(() => {
const content = fs
.readFileSync('./src/tokens/solana.tokenlist.json')
.toString();
JSON.parse(content.toString());
});
});
2 changes: 1 addition & 1 deletion src/tokens/solana.tokenlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -6880,7 +6880,7 @@
"tags": [],
"extensions": {
"website": "https://www.frogsolana.com/"
}
}
}
],
"version": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,

"lib": ["es2017"],
"types": [],
"types": ["node"],
"typeRoots": ["node_modules/@types", "src/types"]
},
"include": ["src/**/*.ts"],
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.1.tgz#283f669ff76d7b8260df8ab7a4262cc83d988256"
integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==

"@types/node@^15.0.2":
version "15.0.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67"
integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==

"@types/normalize-package-data@^2.4.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
Expand Down

0 comments on commit 8bda197

Please sign in to comment.