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

feat: add all the types #635

Merged
merged 19 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 17 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
11 changes: 10 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"extends": "@appium/eslint-config-appium",
"extends": ["@appium/eslint-config-appium-ts"],
"overrides": [
{
"files": "test/**/*.js",
"rules": {
"func-names": "off"
}
},
{
"files": ["./**/scripts/**/*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
},
"parserOptions": {
"sourceType": "script"
}
}
]
}
5 changes: 2 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Unit Tests

on: [pull_request, push]


jobs:
prepare_matrix:
runs-on: ubuntu-latest
Expand All @@ -13,9 +12,9 @@ jobs:
id: generate-matrix
run: echo "versions=$(curl -s https://endoflife.date/api/nodejs.json | jq -c '[[.[] | select(.lts != false)][:3] | .[].cycle | tonumber]')" >> "$GITHUB_OUTPUT"

test:
unit-test:
needs:
- prepare_matrix
- prepare_matrix
strategy:
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ coverage
.nyc_output/
test-results.xml
.DS_Store
docs/reference/
site/
.vscode/
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:commit -- --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:staged
5 changes: 3 additions & 2 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
require: ['@babel/register'],
forbidOnly: Boolean(process.env.CI)
require: ['ts-node/register'],
forbidOnly: Boolean(process.env.CI),
color: true,
};
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": [],
"label": "npm: dev",
"detail": "npm run build -- --watch",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
42 changes: 42 additions & 0 deletions .wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';

module.exports = (wallaby) => {
return {
compilers: {
'**/*.js': wallaby.compilers.typeScript({
allowJs: true,
allowSyntheticDefaultImports: true,
resolveJsonModule: true,
isolatedModules: true,
}),
'**/*.ts?(x)': wallaby.compilers.typeScript(),
},
debug: true,
env: {
type: 'node',
},
files: ['index.ts', 'lib/**/*'],
testFramework: 'mocha',
tests: ['test/unit/**/*-specs.js'],
workers: {
restart: true,
},
setup(wallaby) {
// copied out of `./test/setup.js`

const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');

// The `chai` global is set if a test needs something special.
// Most tests won't need this.
global.chai = chai.use(chaiAsPromised);

// `should()` is only necessary when working with some `null` or `undefined` values.
global.should = chai.should();

const mocha = wallaby.testFramework;
mocha.timeout(10000);
},
runMode: 'onsave',
};
};
25 changes: 0 additions & 25 deletions babel.config.json

This file was deleted.

11 changes: 11 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
'header-max-length': [0],
'subject-case': [0],
'subject-full-stop': [0],
},
};
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// transpile:main
import {install} from 'source-map-support';

import { AndroidUiautomator2Driver } from './lib/driver';
install();

export { AndroidUiautomator2Driver };
import {AndroidUiautomator2Driver} from './lib/driver';

export {AndroidUiautomator2Driver};
export default AndroidUiautomator2Driver;
Loading