test: user-subscription specs fail outside UTC, so the pre-commit hook cannot pass
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- node.js, typescript
- Domínio
- testing
Direção de pesquisa
Comece por test/unit/repositories/user-subscription-repository.spec.ts e execute-o com TZ=UTC e TZ=America/Toronto para reproduzir as cinco falhas. Acompanhe como os specs constroem as datas-limite e como o driver de consultas as representa; torne o limite independente do fuso horário local e verifique o valor passado ao driver. O trabalho estará concluído quando todos os 17 specs passarem nos dois fusos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
test/unit/repositories/user-subscription-repository.spec.ts passes under TZ=UTC and fails under any negative-offset zone, so the pre-commit hook cannot pass for anyone running outside UTC — including this development environment, which is America/Toronto.
$ TZ=UTC npx mocha test/unit/repositories/user-subscription-repository.spec.ts
17 passing
$ TZ=America/Toronto npx mocha test/unit/repositories/user-subscription-repository.spec.ts
12 passing, 5 failing
AssertionError: expected 'select * from "user_subscriptions" wh…' to include '"current_period_end" <= '2026-01-31'
All five are the same defect: the specs build a boundary date and assert the literal 2026-01-31 appears in the generated SQL, but the driver renders the value in the local zone, so at UTC-5 the SQL carries a different instant. The two updateIfCurrent failures are the same cause in the IS NOT DISTINCT FROM clause.
CI is UTC, so main is green and the problem is invisible there. It only appears locally, as a pre-commit failure that looks like the change under test is broken.
Fix direction: make the boundary explicit rather than ambient — construct the dates in UTC (or set process.env.TZ = 'UTC' before the module under test is imported, which Node honours for later Date work) and assert on the value the driver is given, not on a date literal that only matches in UTC.
Found while committing an unrelated compose fix (#929).
- Linguagem predominante
- TypeScript
- Estrelas
- 829
- Forks
- 234
- Merge médio
- 17h 40min
- PRs com merge (30d)
- 90
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cameri/nostream
-
bug factory rewrite rust
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
bug factory rewrite rust
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
bug factory rewrite rust
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
bug factory rewrite rust
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Website
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
Todas as issues de cameri/nostream
Issues semelhantes
-
VS Code extension: clickable file links in chat drop the :line suffix, never jump to the lineAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
MoonshotAI/kimi-code#4398 ·
Mantenedores costumam responder em até 1 dia
-
Xiaomi Mimo语音识别服务异常Abertapending triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
package-lock.json : les binaires natifs macOS et Linux de unrs-resolver ont disparu depuis #1823Abertabug dependencies
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
AxaFrance/design-system#2064 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100