Skip to content

Commit

Permalink
Applied new TestExtension loading
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x98 committed Nov 6, 2023
1 parent 9c97bff commit ea7c306
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -67,12 +65,12 @@ describe('Validation of ArchiveInterpreterExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
12 changes: 5 additions & 7 deletions libs/extensions/std/exec/src/file-picker-executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -71,12 +69,12 @@ describe('Validation of FilePickerExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -67,12 +65,12 @@ describe('Validation of GtfsRTInterpreterExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
12 changes: 5 additions & 7 deletions libs/extensions/std/exec/src/http-extractor-executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -56,12 +54,12 @@ describe('Validation of HttpExtractorExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -67,12 +65,12 @@ describe('Validation of TextFileInterpreterExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
12 changes: 5 additions & 7 deletions libs/extensions/std/exec/src/text-line-deleter-executor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -67,12 +65,12 @@ describe('Validation of TextLineDeleterExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import * as path from 'path';

import * as R from '@jvalue/jayvee-execution';
import { getTestExecutionContext } from '@jvalue/jayvee-execution/test';
import { StdLangExtension } from '@jvalue/jayvee-extensions/std/lang';
import {
BlockDefinition,
IOType,
createJayveeServices,
useExtension,
} from '@jvalue/jayvee-language-server';
import {
ParseHelperOptions,
TestLangExtension,
expectNoParserAndLexerErrors,
loadTestExtensions,
parseHelper,
readJvTestAssetHelper,
} from '@jvalue/jayvee-language-server/test';
Expand Down Expand Up @@ -67,12 +65,12 @@ describe('Validation of TextRangeSelectorExecutor', () => {
);
}

beforeAll(() => {
// Register extensions
useExtension(new StdLangExtension());
useExtension(new TestLangExtension());
beforeAll(async () => {
// Create language services
const services = createJayveeServices(NodeFileSystem).Jayvee;
await loadTestExtensions(services, [
path.resolve(__dirname, '../test/test-extension/TestBlockTypes.jv'),
]);
locator = services.workspace.AstNodeLocator;
// Parse function for Jayvee (without validation)
parse = parseHelper(services);
Expand Down
23 changes: 23 additions & 0 deletions libs/extensions/std/exec/test/test-extension/TestBlockTypes.jv
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
//
// SPDX-License-Identifier: AGPL-3.0-only

builtin blocktype TestFileExtractor {
input inPort oftype None;
output outPort oftype File;
}

builtin blocktype TestFileLoader {
input inPort oftype File;
output outPort oftype None;
}

builtin blocktype TestSheetLoader {
input inPort oftype Sheet;
output outPort oftype None;
}

builtin blocktype TestTextFileLoader {
input inPort oftype TextFile;
output outPort oftype None;
}

0 comments on commit ea7c306

Please sign in to comment.