• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / js-slang / 19080105112

04 Nov 2025 07:13PM UTC coverage: 76.655% (-1.5%) from 78.192%
19080105112

push

github

web-flow
Migrate to Vitest (#1815)

* Upgrade TS to 5.8

* Remove deprecated tsconfig option

* Remove duplicate properties

* Upgrade TS to v5.9

* Add types for mathjs

* Fix some type errors

* Update tsconfig

* Fix more type errors

* Fix remaining errors

* Update GitHub workflows

* Fix type error

* Update scm-slang to latest

* Add newline to EOF

* Fix cse-machine types and utils to use fewer type assertions

* Migrate to vitest tests

* Migrate tests to vitest

* Relocate base error files and types

* Get modules tests working

* run format

* Sort tsconfig compiler options

* Update eslint packages to match typescript version

* Small linting change

* Use function names instead of strings for describe blocks

* Include scripts in linting

* Move tests and replace describe titles with functions

* Add type modifiers and reformat tests

* Simplify isEnvDependent code

* Instruct tsc to ignore py-slang's tests during build

* Move walkers to be under utils/ast

* Update tests failing due to timeout

* Update cse-machine typings

* Incorporate import assertions into docs importer

* Add context property to error result

* Update test timeout and add no-restricted-import rule for commander imports

* Update snapshots

* Run format

* Update snapshots again....

* Run format

* Change to use the test.each

* Disable the svmc snapshot test cause it doesn't work

* Add a new test for properties when loading modules

* Run format

* Convert stdlib parser to use nodetypetonode helper type

* A working version of the statementSeqTransform

* More compact version of seq transform

* Remove unnecessary type assertions

* Clean up some documentation bits and pieces

* Use type imports for tracer

* Swap the list library to use generics

* Fix some error messages and tests

* Fix list tests

* Run format

* Update stream library and tests

* Running format

* Add some documentation for the scripts

* Remove unnecessary packages

* Remove even more unnecessary ty... (continued)

3501 of 4761 branches covered (73.53%)

Branch coverage included in aggregate %.

429 of 636 new or added lines in 54 files covered. (67.45%)

34 existing lines in 12 files now uncovered.

7085 of 9049 relevant lines covered (78.3%)

193248.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/stdlib/stream.ts
1
import { head, is_null, type List, type Pair, pair, tail } from './list'
2

3
export type Stream<T = unknown> = null | Pair<T, () => Stream<T>>
4

5
/**
6
 * Makes a Stream out of its arguments\
7
 * LOW-LEVEL FUNCTION, NOT SOURCE
8
 */
9
export function stream<T>(...elements: T[]): Stream<T> {
10
  if (elements.length === 0) return null
115✔
11

12
  const [item, ...rest] = elements
100✔
13
  return pair(item, () => stream(...rest))
100✔
14
}
15

16
// same as list_to_stream in stream.prelude.ts
17
export function list_to_stream<T>(xs: List<T>): Stream<T> {
UNCOV
18
  return is_null(xs) ? null : pair(head(xs), () => list_to_stream(tail(xs)))
×
19
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc