Skip to content

Commit

Permalink
test: store snapshots in separate sdsstub files (#65)
Browse files Browse the repository at this point in the history
### Summary of Changes

The snapshots to test the stub generator are now stored in separate
`sdsstub` files for easier review.

---------

Co-authored-by: Arsam <[email protected]>
  • Loading branch information
lars-reimann and Masara authored Feb 22, 2024
1 parent fa3d020 commit ced63f3
Show file tree
Hide file tree
Showing 12 changed files with 627 additions and 652 deletions.
2 changes: 0 additions & 2 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ JSON_PRETTIER_FILE_EXTENSIONS:
- .scss
- .htm
- .html
# - .md

# Commands
PRE_COMMANDS:
- command: npm install @lars-reimann/prettier-config
cwd: workspace
18 changes: 18 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Any

import pytest
from syrupy import SnapshotAssertion
from syrupy.extensions.single_file import SingleFileSnapshotExtension
from syrupy.types import SerializedData


class SdsStubExtension(SingleFileSnapshotExtension):
_file_extension = "sdsstub"

def serialize(self, data: str, **_kwargs: Any) -> SerializedData:
return bytes(data, encoding="utf8")


@pytest.fixture()
def snapshot_sds_stub(snapshot: SnapshotAssertion) -> SnapshotAssertion:
return snapshot.use_extension(SdsStubExtension)
Loading

0 comments on commit ced63f3

Please sign in to comment.