Skip to content

Commit 6c37611

Browse files
committed
wip 101
1 parent 47d6669 commit 6c37611

File tree

12 files changed

+55
-29
lines changed

12 files changed

+55
-29
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
],
1111
"scripts": {
1212
"patch": "npx patch-package",
13-
"test": "CDS_STRICT_NODE_VERSION=false jest",
14-
"test:coverage": "jest --runInBand --coverageReporters=html --coverageReporters=text-summary",
13+
"test:prepare": "npx shx test -e test-cap-server/node_modules || npm ci --prefix test-cap-server",
14+
"test": "npm run test:prepare && CDS_STRICT_NODE_VERSION=false jest",
15+
"test:coverage": "npm run test:prepare && CDS_STRICT_NODE_VERSION=false jest --runInBand --coverageReporters=html --coverageReporters=text-summary",
1516
"test:remove-inline-snapshots": "npx replace '\\.toMatchInlineSnapshot\\(\\s*`[\\s\\S]*?`\\s*\\);' '.toMatchInlineSnapshot();' test -r --include='*.test.js'",
1617
"lint": "npm run prettier && npm run eslint && npm run jsdoc",
1718
"lint:fix": "npm run prettier:fix && npm run eslint:fix",

test/cds-test-services/__snapshots__/cds-test-feature-service.test.js.snap renamed to test-cap-server/__snapshots__/cds-test-feature-service.test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`cds-test-feature-service state response no change 1`] = `
3+
exports[`test-cap-server feature-service state response no change 1`] = `
44
{
55
"test/feature_a": {
66
"config": {
@@ -100,7 +100,7 @@ exports[`cds-test-feature-service state response no change 1`] = `
100100
}
101101
`;
102102

103-
exports[`cds-test-feature-service state response with changes 1`] = `
103+
exports[`test-cap-server feature-service state response with changes 1`] = `
104104
{
105105
"test/feature_a": {
106106
"config": {

test/cds-test-services/cds-test-check-service.test.js renamed to test-cap-server/cds-test-check-service.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
"use strict";
22

33
const cds = require("@sap/cds");
4-
const toggles = require("../../src");
4+
const toggles = require("../src");
55

66
// TODO how do we get our plugin and @sap/cds-mtxs loaded as part of the plugin startup here
7-
// NOTE: the cds.test server naturally loads the plugins of the passed in directory test/cds-test-services, which
7+
// NOTE: the cds.test server naturally loads the plugins of the passed in directory test-cap-server, which
88
// in turn defaults to the plugins of the project root, i.e., our cap dev dependencies. Unfortunately, this does
99
// not include our own plugin. So, we patch it in here...
10-
const server = cds.test("test/cds-test-services");
10+
const server = cds.test("test-cap-server");
1111
const systemCall = { validateStatus: () => true, auth: { username: "system", password: "system" } };
1212

13-
describe("cds-test-check-service", () => {
13+
describe("test-cap-server check-service", () => {
1414
afterEach(() => {
1515
jest.clearAllMocks();
1616
});

test/cds-test-services/cds-test-feature-service.test.js renamed to test-cap-server/cds-test-feature-service.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"use strict";
22

33
const cds = require("@sap/cds");
4-
const toggles = require("../../src");
4+
const toggles = require("../src");
55

6-
const { FEATURE, mockConfig: config } = require("../__common__/mockdata");
6+
const { FEATURE, mockConfig: config } = require("../test/__common__/mockdata");
77

8-
const server = cds.test("test/cds-test-services");
8+
const server = cds.test("test-cap-server");
99
const systemCall = { validateStatus: () => true, auth: { username: "system", password: "system" } };
1010

11-
describe("cds-test-feature-service", () => {
11+
describe("test-cap-server feature-service", () => {
1212
beforeEach(async () => {
1313
toggles._reset();
1414
await toggles.initializeFeatures({ config });

test/cds-test-services/fts/check-service-extension/check-service-extension.cds renamed to test-cap-server/fts/check-service-extension/check-service-extension.cds

File renamed without changes.
Lines changed: 34 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-cap-server/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"private": true,
3+
"dependencies": {
4+
"@sap/cds-mtxs": "file://../node_modules/@sap/cds-mtxs",
5+
"@cap-js/sqlite": "file://../node_modules/@cap-js/sqlite",
6+
"@cap-js-community/feature-toggle-library": "file://../"
7+
}
8+
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)