Skip to content

puyaTsTransformer breaks division in vitest #83

@tasosbit

Description

@tasosbit

Subject of the issue

In the default puya ts algokit template, puyaTsTransformer breaks vitest's division:

3/2 == 1

Runing the vitest config with the transformer removed works.

Repro repo here

Your environment

[email protected] /home/bit/code/repro-numbers/projects/repro-numbers-contracts
├─┬ @algorandfoundation/[email protected]
│ ├── @algorandfoundation/[email protected]
│ └─┬ @algorandfoundation/[email protected]
│ └── @algorandfoundation/[email protected] deduped
├── @algorandfoundation/[email protected]
└─┬ @algorandfoundation/[email protected]
└── @algorandfoundation/[email protected] deduped
timestamp: 2025-07-18T19:36:36+00:00
AlgoKit: 2.7.1
AlgoKit Python: 3.12.4 (main, Jun 8 2024, 18:29:57) [GCC 11.4.0] (location: /home/bit/.local/pipx/venvs/algokit)
OS: Linux-6.0.8-x86_64-with-glibc2.35
docker: 27.0.3
docker compose: 2.28.1
git: 2.34.1
python: 2.7.18 (location: /usr/local/bin/python)
python3: 3.10.12 (location: /usr/bin/python3)
pipx: 1.7.1
poetry: 1.8.3
node: 22.17.0
npm: 10.9.2

Steps to reproduce

1.Divide in vitest with remainder, e.g. 3/2

Expected behaviour

3/2 ~== 1.5

Actual behaviour

3/2 ~== 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions