Skip to content

Commit

Permalink
test adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 10, 2023
1 parent 722b536 commit 3f3e208
Show file tree
Hide file tree
Showing 14 changed files with 1,978 additions and 9,475 deletions.
1,035 changes: 124 additions & 911 deletions generators/spring-data-cassandra/__snapshots__/generator.spec.mts.snap

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions generators/spring-data-cassandra/generator.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { fileURLToPath } from 'url';
import { expect } from 'esmocha';
import lodash from 'lodash';

import { buildServerSamples, entitiesSimple as entities, defaultHelpers as helpers } from '../../test/support/index.mjs';
import { buildServerSamples, entitiesSimple as entities, defaultHelpers as helpers, runResult } from '../../test/support/index.mjs';
import { shouldSupportFeatures, testBlueprintSupport } from '../../test/support/tests.mjs';
import Generator from '../server/index.mjs';

Expand Down Expand Up @@ -64,14 +64,21 @@ describe(`generator - ${databaseType}`, () => {
const { authenticationType } = sampleConfig;

describe(name, () => {
let runResult;
if (
sampleConfig.websocket &&
(sampleConfig.reactive || sampleConfig.applicationType === 'microservice' || sampleConfig.applicationType === 'gateway')
) {
it('should throw an error', async () => {
await expect(helpers.runJHipster(generatorFile).withJHipsterConfig(sampleConfig)).rejects.toThrow();
});

return;
}

before(async () => {
runResult = await helpers.run(generatorFile).withJHipsterConfig(sampleConfig, entities).withMockedGenerators(mockedGenerators);
await helpers.run(generatorFile).withJHipsterConfig(sampleConfig, entities).withMockedGenerators(mockedGenerators);
});

after(() => runResult.cleanup());

it('should match generated files snapshot', () => {
expect(runResult.getStateSnapshot()).toMatchSnapshot();
});
Expand Down
Loading

0 comments on commit 3f3e208

Please sign in to comment.