Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ma7dev committed Dec 12, 2021
0 parents commit 6b8ab2a
Show file tree
Hide file tree
Showing 136 changed files with 17,242 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
"curly": ["error", "multi-line", "consistent"],
"dot-location": ["error", "property"],
"handle-callback-err": "off",
"indent": ["error", "tab"],
"keyword-spacing": "error",
"max-nested-callbacks": ["error", { "max": 4 }],
"max-statements-per-line": ["error", { "max": 2 }],
"no-console": "off",
"no-empty-function": "error",
"no-floating-decimal": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
"no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }],
"no-trailing-spaces": ["error"],
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"yoda": "error"
}
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config.json
node_modules
.vscode
.env
ca-certificate.crt
*.jit
*.pt
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# ASC_ROBOT
33 changes: 33 additions & 0 deletions github-actions-reporter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// credit: https://joelhooks.com/jest-and-github-actions
class GithubActionsReporter {
constructor(globalConfig, options) {
this._globalConfig = globalConfig;
this._options = options;
}
onRunComplete(contexts, results) {
results.testResults.forEach((testResultItem) => {
const testFilePath = testResultItem.testFilePath;
testResultItem.testResults.forEach((result) => {
if (result.status !== "failed") {
return;
}
result.failureMessages.forEach((failureMessages) => {
const newLine = "%0A";
const message = failureMessages.replace(/\n/g, newLine);
const captureGroup = message.match(/:([0-9]+):([0-9]+)/);
if (!captureGroup) {
console.log(
"Unable to extract line number from call stack"
);
return;
}
const [, line, col] = captureGroup;
console.log(
`::error file=${testFilePath},line=${line},col=${col}::${message}`
);
});
});
});
}
}
module.exports = GithubActionsReporter;
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testEnvironment: "node",
};
Loading

0 comments on commit 6b8ab2a

Please sign in to comment.