Skip to content
Snippets Groups Projects
Unverified Commit 13f12d97 authored by shaun's avatar shaun Committed by GitHub
Browse files

allow cypress specs to be written in TypeScript (#36813)

parent 0b009811
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ const isFolder = !!folder;
const isOpenMode = args["--open"];
const getSourceFolder = folder => {
return `./e2e/test/scenarios/${folder}/**/*.cy.spec.js`;
return `./e2e/test/scenarios/${folder}/**/*.cy.spec.{js,ts}`;
};
const runCypress = async (baseUrl, exitFunction) => {
......
......@@ -119,7 +119,7 @@ const defaultConfig = {
// New `specPattern` is the combination of the old:
// 1. testFiles and
// 2. integrationFolder
specPattern: "e2e/test/**/*.cy.spec.js",
specPattern: "e2e/test/**/*.cy.spec.{js,ts}",
};
const mainConfig = {
......@@ -147,13 +147,13 @@ const snapshotsConfig = {
const crossVersionSourceConfig = {
...defaultConfig,
baseUrl: "http://localhost:3000",
specPattern: "e2e/test/scenarios/cross-version/source/**/*.cy.spec.js",
specPattern: "e2e/test/scenarios/cross-version/source/**/*.cy.spec.{js,ts}",
};
const crossVersionTargetConfig = {
...defaultConfig,
baseUrl: "http://localhost:3001",
specPattern: "e2e/test/scenarios/cross-version/target/**/*.cy.spec.js",
specPattern: "e2e/test/scenarios/cross-version/target/**/*.cy.spec.{js,ts}",
};
const stressTestConfig = {
......
......@@ -5,7 +5,7 @@ const path = require("path");
const glob = require("glob");
const chalk = require("chalk");
const E2E_FILE_EXTENSION = ".cy.spec.js";
const E2E_FILE_EXTENSION = /\.cy\.spec\.(js|ts)$/;
const E2E_HOME = "e2e/test/";
init();
......@@ -16,7 +16,7 @@ function validateE2EFileNames(files) {
}
const invalidFileNames = files.filter(fullPath => {
return !path.basename(fullPath).endsWith(E2E_FILE_EXTENSION);
return !path.basename(fullPath).match(E2E_FILE_EXTENSION);
});
printFeedback(invalidFileNames);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment