testing library
The contract test harness of the module model: checks that modules and
role templates follow the rules of their roles, and renders the apps
they make in memory. ModulePackage checks what the package of a module
imports and depends on.
It runs without package:test, so both the tests of this package and the
contract tests of the CLI can use it.
Classes
- AddedImport
- An import that the pipeline added to a file of the app for a fragment, with who contributed the fragment.
- Collected
- A contribution with who made it and whether it applies in the app.
- Collection
- Stage 4 of the pipeline: the contributions of every module, of the variants that apply, and of the templates of the present roles.
- ContractCase
- One app the harness builds to check a module or a role: the modules asked for and the provider picked for each role.
- ContractHarness
- The contract test harness: checks that the modules and roles of a registry follow the rules of the module model, the way the pipeline would generate them in every combination that matters.
- ContractResult
- What the harness found in one ContractCase.
- ContributionOrder
- The contributions of a socket, or the post-generation steps, in the order they render or run.
- DartFileIndexer
-
Builds the
DartFileIndexof a Dart file by parsing it, without resolving any type. - DependencyOf
- Another module depends on the module.
- MergedDependency
- A dependency of the merged pubspec.
- MergedPubspec
-
The
pubspec.yamlof the app, merged from everyPubspecContribution. - ModulePackage
- The package of a module and the rules it follows, which the package checks in its own tests with problems:
- OrderEdge
- An edge of the order of contributors: before comes before after.
- ProviderOf
- The module provides a role the app needs.
- RenderedApp
- The app that stage 8 rendered, in memory.
- RenderedFile
- A file of the app that stage 8 rendered.
- Requested
- The user asked for the module.
- Resolution
- Stage 3 of the pipeline: the modules of the app and the roles they provide.
- ResolvedModule
- A module of the app, with why it is there and which of its variants applies.
- SelectionReason
- Why a module is in the app.
- TemplateScan
- What scanTemplate found in a template file.
- TemplateSection
-
A mustache section in a template file,
{{#name}}or{{^name}}, as the scan found it. - TemplateTag
-
A mustache variable in a template file, as the scan found it: the tag of
a socket, whose name starts with
smf, or another variable, such as a variable of a role's render hook. - ValidationResult
- What stage 5 found and computed.
Functions
-
checkTemplateTags(
{required ModuleRegistry registry, required Resolution resolution, required Collection collection}) → List< SmfIssue> -
Checks the tags of the sockets in the bricks among
collection's contributions that apply: -
missingTemplateTags(
{required ModuleRegistry registry, required Resolution resolution, required Collection collection}) → List< SmfIssue> -
Checks that the bricks among
collection's contributions that apply hold every tag they must: of every socket of a present role, in the bricks of the role's template or providers; of every socket of a module, in its bricks; and of every socket of the pipeline. Stage 5 checks the sockets that get contributions, members of socket families included. -
scanTemplate(
String path, String text) → TemplateScan -
Finds the variables and sections in
text, the template file atpath. -
templateFilesOf(
BrickContribution brick) → Map< String, String> -
The text files of
brick, by path with forward slashes, decoded from its bundle; seetemplateTextOf.