Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a github action to test on push #268

Merged
merged 7 commits into from
Jun 7, 2020
Merged
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
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [push]

jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 8.x
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run prettier-check
- name: Run tests
uses: GabrielBB/[email protected]
with:
run: npm test
123 changes: 93 additions & 30 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@
"pretest": "npm run compile && npm run test-compile",
"test": "node ./out/test/runTest.js",
"sync-changelog": "node ./node_modules/github-releases-renderer/index.js run aioutecism amVim-for-VSCode CHANGELOG.template.md CHANGELOG.md -c 0",
"prettier-check": "prettier --list-different '{src,test}/**/*.ts'",
"prettier-write": "prettier --write '{src,test}/**/*.ts'"
"prettier-check": "prettier --list-different \"{src,test}/**/*.ts\"",
"prettier-write": "prettier --write \"{src,test}/**/*.ts\""
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.7",
"@types/mocha": "^7.0.2",
"@types/node": "^8.10.61",
"@types/vscode": "^1.32.0",
"github-releases-renderer": "github:aioutecism/github-releases-renderer",
"glob": "^7.1.6",
"mocha": "^6.2.3",
"mocha": "^7.2.0",
"prettier": "^1.19.1",
"source-map-support": "^0.5.19",
"ts-loader": "^7.0.5",
Expand Down
4 changes: 0 additions & 4 deletions src/Motions/Match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ export class MotionMatch extends Motion {
return obj;
}

static clearLast() {
MotionMatch.last = undefined;
}

static repeatLast(args: { isReverse?: boolean; n?: number }): Motion {
return MotionMatch.last ? MotionMatch.last.clone(args) : new MotionEmpty();
}
Expand Down
13 changes: 8 additions & 5 deletions test/ModeNormal/comma.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as BlackBox from '../Framework/BlackBox';
import { MotionMatch } from '../../src/Motions/Match';

suite('Normal: ,', () => {
MotionMatch.clearLast();

const testCases: BlackBox.TestCase[] = [
// Empty
// Empty - can only be tested in a fresh document
//{
// from: 'Foo aaa bbb ccc e[]nd\nBar end',
// inputs: ',',
// to: 'Foo aaa bbb ccc e[]nd\nBar end',
//},
// Empty - after no match
{
from: 'Foo aaa bbb ccc e[]nd\nBar end',
inputs: ',',
inputs: 'f X ,',
to: 'Foo aaa bbb ccc e[]nd\nBar end',
},
// f <char>
Expand Down
13 changes: 8 additions & 5 deletions test/ModeNormal/semicolon.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import * as BlackBox from '../Framework/BlackBox';
import { MotionMatch } from '../../src/Motions/Match';

suite('Normal: ;', () => {
MotionMatch.clearLast();

const testCases: BlackBox.TestCase[] = [
// Empty
// Empty - can only be tested in a fresh document
//{
// from: '[]Foo aaa bbb ccc end\nBar end',
// inputs: ';',
// to: '[]Foo aaa bbb ccc end\nBar end',
//},
// Empty - after no match
{
from: '[]Foo aaa bbb ccc end\nBar end',
inputs: ';',
inputs: 'f X ;',
to: '[]Foo aaa bbb ccc end\nBar end',
},
// f <char>
Expand Down
1 change: 1 addition & 0 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function run(): Promise<void> {
const mocha = new Mocha({
ui: 'tdd',
timeout: 2500,
retries: 2,
});
mocha.useColors(true);

Expand Down