[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] branch master updated: add copyrights and li
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] branch master updated: add copyrights and lint |
Date: |
Tue, 27 Apr 2021 15:19:09 +0200 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository merchant-backoffice.
The following commit(s) were added to refs/heads/master by this push:
new 08a696a add copyrights and lint
08a696a is described below
commit 08a696ad83613da157c223caa9c7f75c49dc1df1
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Apr 27 10:05:11 2021 -0300
add copyrights and lint
---
packages/frontend/package.json | 4 +-
.../frontend/tests/__mocks__/fileTransformer.js | 28 ++++++++++--
packages/frontend/tests/stories.test.tsx | 51 ++++++++++++++++------
3 files changed, 64 insertions(+), 19 deletions(-)
diff --git a/packages/frontend/package.json b/packages/frontend/package.json
index 02e598b..7d54bc6 100644
--- a/packages/frontend/package.json
+++ b/packages/frontend/package.json
@@ -8,7 +8,7 @@
"compile": "tsc",
"serve": "sirv build --port ${PORT:=8080} --cors --single",
"dev": "preact watch --port ${PORT:=8080} --no-sw --no-esm",
- "lint-check": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
+ "lint-check": "eslint '{src,tests}/**/*.{js,jsx,ts,tsx}'",
"lint-fix": "eslint --fix 'src/**/*.{js,jsx,ts,tsx}'",
"test": "jest ./tests",
"typedoc": "typedoc src",
@@ -117,4 +117,4 @@
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|po)$":
"<rootDir>/tests/__mocks__/fileTransformer.js"
}
}
-}
\ No newline at end of file
+}
diff --git a/packages/frontend/tests/__mocks__/fileTransformer.js
b/packages/frontend/tests/__mocks__/fileTransformer.js
index fb0ad54..e6193f8 100644
--- a/packages/frontend/tests/__mocks__/fileTransformer.js
+++ b/packages/frontend/tests/__mocks__/fileTransformer.js
@@ -1,9 +1,31 @@
+/*
+ This file is part of GNU Taler
+ (C) 2021 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+*
+* @author Sebastian Javier Marchano (sebasjm)
+*/
// fileTransformer.js
+
+// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');
module.exports = {
- process(src, filename, config, options) {
- return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
- },
+ process(src, filename, config, options) {
+ return 'module.exports = ' + JSON.stringify(path.basename(filename)) +
';';
+ },
};
diff --git a/packages/frontend/tests/stories.test.tsx
b/packages/frontend/tests/stories.test.tsx
index afc9a11..aeb5911 100644
--- a/packages/frontend/tests/stories.test.tsx
+++ b/packages/frontend/tests/stories.test.tsx
@@ -1,20 +1,40 @@
+/*
+ This file is part of GNU Taler
+ (C) 2021 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+
+/**
+*
+* @author Sebastian Javier Marchano (sebasjm)
+*/
import { mount } from 'enzyme';
import { h } from 'preact';
import * as ctx from '../src/context/backend';
-const fs = require('fs');
-
-function getFiles (dir: string, files_: string[] = []){
- var files = fs.readdirSync(dir);
- for (var i in files){
- var name = dir + '/' + files[i];
- if (fs.statSync(name).isDirectory()){
- getFiles(name, files_);
- } else {
- files_.push(name);
- }
+import fs from 'fs';
+
+function getFiles(dir: string, files_: string[] = []) {
+ const files = fs.readdirSync(dir);
+ for (const i in files) {
+ const name = dir + '/' + files[i];
+ if (fs.statSync(name).isDirectory()) {
+ getFiles(name, files_);
+ } else {
+ files_.push(name);
}
- return files_;
+ }
+ return files_;
}
const re = RegExp('.*\.stories.tsx')
@@ -23,12 +43,15 @@ it('render every story', () => {
jest.spyOn(ctx, 'useConfigContext').mockImplementation(() => ({ version:
'1.0.0', currency: 'EUR' }));
getFiles('./src').filter(f => re.test(f)).map(f => {
- const s = require('../'+f)
+
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
+ const s = require('../' + f)
+
delete s.default
Object.keys(s).forEach(k => {
const Component = s[k];
try {
- mount(<Component {...Component.args}/>);
+ mount(<Component {...Component.args} />);
} catch (error) {
console.error(`problem rendering ${f} example ${k}`, error)
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant-backoffice] branch master updated: add copyrights and lint,
gnunet <=