chore: use generated types from vega protos - update int tests

This commit is contained in:
maciek
2023-06-22 13:59:16 +02:00
parent 456287a159
commit efced9db32
6 changed files with 62 additions and 8 deletions
+29
View File
@@ -1,4 +1,10 @@
const { defineConfig } = require('cypress');
const webpack = require('webpack');
const webpackPreprocessor = require('@cypress/webpack-batteries-included-preprocessor');
const path = require('path');
const dotenv = require('dotenv');
dotenv.config();
module.exports = defineConfig({
reporter: '../../node_modules/cypress-mochawesome-reporter',
@@ -7,6 +13,29 @@ module.exports = defineConfig({
setupNodeEvents(on, config) {
require('cypress-mochawesome-reporter/plugin')(on);
require('@cypress/grep/src/plugin')(config);
const defaultConfig = webpackPreprocessor.defaultOptions;
defaultConfig.webpackOptions.context = path.resolve(__dirname, './');
defaultConfig.webpackOptions.module.rules[1].test = /(\.tsx?|\.jsx?)$/;
defaultConfig.webpackOptions.module.rules[1].exclude = [
/node_modules\/(?!(@vegaprotocol\/protos|protobuf-codec))/,
/browserslist/,
];
defaultConfig.webpackOptions.module.rules.push({
test: /(\.css|\.s[ac]ss)$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
});
defaultConfig.webpackOptions.plugins =
defaultConfig.webpackOptions.plugins || [];
defaultConfig.webpackOptions.plugins.push(
new webpack.DefinePlugin({
'process.env': JSON.stringify(process.env),
})
);
defaultConfig.typescript = require.resolve('typescript');
on('file:preprocessor', webpackPreprocessor(defaultConfig));
return config;
},
baseUrl: 'http://localhost:3000',
+29
View File
@@ -1,4 +1,10 @@
const { defineConfig } = require('cypress');
const webpack = require('webpack');
const webpackPreprocessor = require('@cypress/webpack-batteries-included-preprocessor');
const path = require('path');
const dotenv = require('dotenv');
dotenv.config();
module.exports = defineConfig({
reporter: '../../node_modules/cypress-mochawesome-reporter',
@@ -7,6 +13,29 @@ module.exports = defineConfig({
setupNodeEvents(on, config) {
require('cypress-mochawesome-reporter/plugin')(on);
require('@cypress/grep/src/plugin')(config);
const defaultConfig = webpackPreprocessor.defaultOptions;
defaultConfig.webpackOptions.context = path.resolve(__dirname, './');
defaultConfig.webpackOptions.module.rules[1].test = /(\.tsx?|\.jsx?)$/;
defaultConfig.webpackOptions.module.rules[1].exclude = [
/node_modules\/(?!(@vegaprotocol\/protos|protobuf-codec))/,
/browserslist/,
];
defaultConfig.webpackOptions.module.rules.push({
test: /(\.css|\.s[ac]ss)$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
});
defaultConfig.webpackOptions.plugins =
defaultConfig.webpackOptions.plugins || [];
defaultConfig.webpackOptions.plugins.push(
new webpack.DefinePlugin({
'process.env': JSON.stringify(process.env),
})
);
defaultConfig.typescript = require.resolve('typescript');
on('file:preprocessor', webpackPreprocessor(defaultConfig));
return config;
},
baseUrl: 'http://localhost:4210',
+1 -2
View File
@@ -15,8 +15,7 @@ module.exports = defineConfig({
const defaultConfig = webpackPreprocessor.defaultOptions;
defaultConfig.webpackOptions.context = path.resolve(__dirname, './');
defaultConfig.webpackOptions.module.rules[1].test =
/(\.tsx?|\.jsx?|\.mjs)$/;
defaultConfig.webpackOptions.module.rules[1].test = /(\.tsx?|\.jsx?)$/;
defaultConfig.webpackOptions.module.rules[1].exclude = [
/node_modules\/(?!(@vegaprotocol\/protos|protobuf-codec))/,
/browserslist/,
@@ -79,8 +79,7 @@ describe(
price: '100000',
postOnly: false,
reduceOnly: false,
expiresAt:
new Date(order.expiresAt as string).getTime().toString() + '000000',
expiresAt: order.expiresAt as string,
});
});
}
@@ -77,8 +77,7 @@ describe(
createOrder(order);
testOrderSubmission(order, {
price: '100000',
expiresAt:
new Date(order.expiresAt as string).getTime().toString() + '000000',
expiresAt: order.expiresAt as string,
});
});
}
@@ -77,8 +77,7 @@ describe(
createOrder(order);
testOrderSubmission(order, {
price: '100000',
expiresAt:
new Date(order.expiresAt as string).getTime().toString() + '000000',
expiresAt: order.expiresAt as string,
});
});
}