Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

fix: fix tests and switch to github actions #183

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ${{ matrix.platform }}
name: "${{ matrix.platform }} ${{ matrix.nodeversion }}"
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
nodeversion: ['12.x', '14.x', '15.x']
ENV: ['ci', 'ci-betanet']
steps:
- uses: actions/checkout@v2
- name: Use Node.js v"${{ matrix.nodeversion }}""
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.nodeversion }}
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Install dependencies
run: yarn build
- name: test
env:
YARN_GPG: no
NODE_ENV: ${{ matrix.ENV }}
run: yarn test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ dev-account.env

# ignore contract build files
build/release
out/
2 changes: 1 addition & 1 deletion as-pect.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('near-sdk-as/imports');
module.exports = require('near-sdk-as/as-pect.config');
3 changes: 1 addition & 2 deletions asconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "near-sdk-as/asconfig.json",
"options": {
"measure": true,
"binaryFile": "./build/release/contract.wasm"
"binaryFile": "out/main.wasm"
}
}
6 changes: 3 additions & 3 deletions assembly/__tests__/token.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Context, u128 } from "near-sdk-as";
import { VMContext, u128 } from "near-sdk-as";
import { init, totalSupply, balanceOf, transfer, approve, transferFrom } from "..";

let alice = 'alice';
Expand All @@ -12,8 +12,8 @@ describe('Token', function() {

describe('with alice as initial owner', () => {
beforeEach(() => {
Context.setSigner_account_id(alice);
Context.setAccount_balance(u128.fromString("1000000"));
VMContext.setSigner_account_id(alice);
VMContext.setAccount_balance(u128.fromString("1000000"));
init(alice);
});

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"version": "0.0.1",
"scripts": {
"build": "asb --verbose",
"dev:deploy:contract": "near dev-deploy --wasmFile=\"./build/release/contract.wasm\"",
"dev:deploy:contract": "near dev-deploy",
"deploy:contract": "near deploy",
"deploy": "yarn build && yarn deploy:contract && yarn deploy:pages",
"pretest": "yarn build",
"prestart": "yarn build && yarn deploy:contract",
"start": "parcel src/index.html",
"asp": "asp --verbose",
Expand Down
Loading