ui5-test-runner 4.3.1 โ†’ 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui5-test-runner",
3
- "version": "4.3.1",
3
+ "version": "4.4.0",
4
4
  "description": "Standalone test runner for UI5",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -69,7 +69,7 @@
69
69
  "reserve": "^1.15.8"
70
70
  },
71
71
  "devDependencies": {
72
- "@openui5/types": "^1.121.0",
72
+ "@openui5/types": "^1.121.1",
73
73
  "@ui5/cli": "^3.9.1",
74
74
  "@ui5/middleware-code-coverage": "^1.1.1",
75
75
  "jest": "^29.7.0",
@@ -3,6 +3,7 @@
3
3
  const { stop } = require('./browsers')
4
4
  const { URL } = require('url')
5
5
  const { getOutput } = require('./output')
6
+ const { stripUrlHash } = require('./tools')
6
7
 
7
8
  module.exports = {
8
9
  async addTestPages (job, url, pages) {
@@ -10,7 +11,7 @@ module.exports = {
10
11
  let testPageUrls
11
12
  pages = pages.map(relativeUrl => {
12
13
  const absoluteUrl = new URL(relativeUrl, url)
13
- return absoluteUrl.toString()
14
+ return stripUrlHash(absoluteUrl.toString())
14
15
  })
15
16
  if (job.pageFilter) {
16
17
  const filter = new RegExp(job.pageFilter)
package/src/job.js CHANGED
@@ -107,6 +107,7 @@ function getCommand (cwd) {
107
107
  .option('-bt, --browser-close-timeout <timeout>', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช] Maximum waiting time for browser close', timeout, 2000)
108
108
  .option('-br, --browser-retry <count>', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช] Browser instantiation retries : if the command fails unexpectedly, it is re-executed (0 means no retry)', 1)
109
109
  .option('-oi, --output-interval <interval>', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช] Interval for reporting progress on non interactive output (CI/CD) (0 means no output)', timeout, 30000)
110
+ .option('--offline', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช] Limit network usage (implies --no-npm-install)', boolean, false)
110
111
 
111
112
  // Common to legacy and url
112
113
  .option('--webapp <path>', '[๐Ÿ’ป๐Ÿ”—] Base folder of the web application (relative to cwd)', 'webapp')
@@ -226,6 +227,9 @@ function finalize (job) {
226
227
  .forEach(setting => updateToAbsolute(setting))
227
228
  if (job.cache) {
228
229
  updateToAbsolute('cache')
230
+ if (job.preload && job.offline) {
231
+ throw new Error('--preload cannot be used with --offline')
232
+ }
229
233
  } else if (job.preload) {
230
234
  throw new Error('--preload cannot be used without --cache')
231
235
  }
package/src/npm.js CHANGED
@@ -61,7 +61,7 @@ async function findDependencyPath (job, name) {
61
61
  const globalPath = join(globalRoot, name)
62
62
  let justInstalled = false
63
63
  if (!await folderExists(globalPath)) {
64
- if (!job.npmInstall) {
64
+ if (!job.npmInstall || job.offline) {
65
65
  throw UTRError.NPM_DEPENDENCY_NOT_FOUND(name)
66
66
  }
67
67
  const previousStatus = job.status
@@ -90,7 +90,7 @@ module.exports = {
90
90
  const installedPackage = require(join(modulePath, 'package.json'))
91
91
  const { version: installedVersion } = installedPackage
92
92
  output.resolvedPackage(name, modulePath, installedVersion)
93
- if (!justInstalled) {
93
+ if (!justInstalled && !job.offline) {
94
94
  const latestVersion = await npm(job, 'view', name, 'version')
95
95
  if (latestVersion !== installedVersion) {
96
96
  output.packageNotLatest(name, latestVersion)