fix: import date.js and fix e2e
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-01-23 15:16:42 +01:00
parent fe656aa125
commit 4a06b8e8a9
9 changed files with 15 additions and 38 deletions

View File

@ -2,7 +2,7 @@ CREATE SCHEMA IF NOT EXISTS `vn2008`;
CREATE SCHEMA IF NOT EXISTS `tmp`;
UPDATE `util`.`config`
SET `environment`= 'test';
SET `environment`= 'development';
ALTER TABLE `vn`.`itemTaxCountry` AUTO_INCREMENT = 1;
ALTER TABLE `vn`.`address` AUTO_INCREMENT = 1;

View File

@ -2,6 +2,7 @@
import Puppeteer from 'puppeteer';
import {extendPage} from './extensions';
import {url as defaultURL} from './config';
import 'vn-loopback/server/boot/date.js';
export async function getBrowser() {
const args = [

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
fdescribe('Client balance path', () => {
describe('Client balance path', () => {
let browser;
let page;
beforeAll(async() => {

View File

@ -1,16 +1,13 @@
Date.vnUTC = () => {
const env = process.env.NODE_ENV;
if (!env || env === 'development')
return new Date(Date.UTC(2022, 5, 15, 11));
// try import 'vn-loopback/server/boot/date';
return new Date(Date.UTC());
Date.vnUTC = () => {
return new Date(Date.UTC(2022, 5, 15, 11));
};
Date.vnNew = () => {
return new Date(Date.vnUTC());
return new Date(Date.UTC(2022, 5, 15, 11));
};
Date.vnNow = () => {
return new Date(Date.vnUTC()).getTime();
return new Date(Date.UTC(2022, 5, 15, 11)).getTime();
};

View File

@ -10,7 +10,7 @@
<body>
<vn-app></vn-app>
<script type="text/javascript"
src="/routes.js">
src="/routes.js?<%= new Date().getTime() %>">
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
import './module';
import './routes';
import './components';
import './services';
import './styles';
import 'vn-loopback/server/boot/date';

View File

@ -1,15 +0,0 @@
Date.vnUTC = () => {
const env = process.env.NODE_ENV;
if (!env || env === 'development')
return new Date(Date.UTC(2000, 0, 1, 11));
return new Date(Date.UTC());
};
Date.vnNew = () => {
return new Date(Date.vnUTC());
};
Date.vnNow = () => {
return new Date(Date.vnUTC()).getTime();
};

View File

@ -14,6 +14,10 @@ import './modules/ticket/front/module.js';
import './modules/travel/front/module.js';
import './modules/worker/front/module.js';
import './modules/shelving/front/module.js';
import 'vn-loopback/server/boot/date';
// Set NODE_ENV
process.env.NODE_ENV = 'development';
core.run(vnInterceptor => {
vnInterceptor.setApiPath(null);
@ -37,17 +41,6 @@ window.ngModule = function(moduleName, ...args) {
if (args.length)
fns = fns.concat(args);
Date.vnUTC = () => {
return new Date(Date.UTC(2022, 5, 15, 11));
};
Date.vnNew = () => {
return new Date(Date.UTC(2022, 5, 15, 11));
};
Date.vnNow = () => {
return new Date(Date.UTC(2022, 5, 15, 11)).getTime();
};
return angular.mock.module(...fns);
};

View File

@ -1,5 +1,6 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
/* eslint max-len: ["error", { "code": 150 }]*/
module.exports = {
name: 'front end',