首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏DevOps

    Go:微服务架构下的单元测试(基于 Ginkgo、gomock 、Gomega

    简介 本文主要使用 Ginkgo[2] 、gomock[3] 、Gomega[4] 工具来实现单元测试,之前不了解的同学,可以先熟悉一下相关文档。 第二条命令安装了全部 gomega 库。 这样可以导入 gomega 包到你的测试代码中: import "github.com/onsi/gomega" import "github.com/onsi/ginkgo" Ginkgo 与 Go string) 功能来表示失败 // 使用 RegisterFailHandler 将此函数传递给 Gomega 。 这是 Ginkgo 和 Gomega 之间的唯一连接点 RegisterFailHandler(Fail) // 通知 Ginkgo 启动测试套件。

    1K11编辑于 2024-03-29
  • 来自专栏LEo的网络日志

    30 Oct 2020 ginkgo学习(一)

    "github.com/onsi/gomega" ) func TestBooks(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Books go: finding module for package github.com/onsi/ginkgo go: finding module for package github.com/onsi/gomega go: found github.com/onsi/ginkgo in github.com/onsi/ginkgo v1.14.2 go: found github.com/onsi/gomega in github.com/onsi/gomega v1.10.3 Running Suite: Books Suite ========================== Random Seed: "github.com/onsi/gomega" ) type Book struct { Title string Author string Pages int } func (b *

    29140编辑于 2023-10-17
  • 来自专栏Golang语言社区

    Go 的浏览器集成测试

    浏览器集成测试 agouti 官网上的例子推荐使用 agouti + Ginkgo + Gomega 的组合,本着用的工具越简单,工具本身带来 bug 机率越小的原则, 试验了一下, 最后选择了 agouti + Gomega 的组合, 主要是看中了 Gomega 提供的 one line assertion, 而 Ginkgo 的描述式 DSL 就没什么吸引力了。 = nil { t.Error("Failed to open page.") } RegisterTestingT(t) // 注册 Gomega test := m.Run

    1.7K60发布于 2018-03-21
  • 来自专栏DevOps

    Go:基于BDD的测试框架 Ginkgo 简介及实践

    但 Ginkgo 建议的是搭配gomega库一起使用。 安装Ginkgo go get github.com/onsi/ginkgo/ginkgo go get github.com/onsi/gomega/... 2. "github.com/onsi/gomega" ) var _ = Describe(“Math”, func() { DescribeTable(“the > inequality”, “github.com/onsi/gomega” ) var _ = Describe(“Math”, func() { Describe(“the > inequality”, It(“

    2K10编辑于 2024-03-29
  • 来自专栏Jenkins

    Jenkins CLI 命令行 v0.0.24

    LinuxSuRen 把 github.com/onsi/ginkgo 从 1.10.3 升级到 1.11.0 (#288) @dependabot-preview 把 github.com/onsi/gomega

    61641发布于 2020-01-03
  • 来自专栏AI科技大本营的专栏

    Go开发者路线图2019,请收下这份指南

    github.com/golang/mock Testify:https://github.com/stretchr/testify GinkGo:https://github.com/onsi/ginkgo GoMega :https://github.com/onsi/gomega GoCheck:https://github.com/go-check/check GoDog:https://github.com/DATA-DOG

    1.9K52发布于 2019-05-14
  • 来自专栏IT综合技术分享

    组件分享之后端组件——Go开发者路线图库

    Go-Underscore](https://github.com/ahl5esoft/golang-underscore) 测试 单元、行为和集成测试 GoMock Testify GinkGo GoMega

    1.1K20编辑于 2022-03-06
  • 来自专栏睿哥杂货铺

    基于Kafka构建事件溯源模式的微服务

    govendor $ cd $PROJECT_PATH $ govendor init $ govendor add +external $ 单元测试:ginkgo Test Suite ginkgo gomega $ go get github.com/onsi/ginkgo/ginkgo $ go get github.com/onsi/gomega $ ginkgo bootstrap Generating main_test //go_microservice_suite_test.go,单元测试类 import ( "github.com/onsi/ginkgo" "github.com/onsi/gomega u github.com/kardianos/govendor RUN go get github.com/onsi/ginkgo/ginkgo RUN go get github.com/onsi/gomega

    2.2K70发布于 2018-01-12
  • 来自专栏Jenkins

    Jenkins CLI 命令行 v0.0.31

    Bump github.com/onsi/ginkgo from 1.14.0 to 1.14.2 (#449 #451) @dependabot-preview Bump github.com/onsi/gomega

    64410发布于 2020-12-11
  • 来自专栏ccf19881030的博客

    Go 开发者路线图

    graphql-go 最好知道 Validator Glow GJson Authboss Go-Underscore 测试 单元、行为和集成测试 GoMock Testify GinkGo GoMega

    1.3K30发布于 2020-10-28
  • 来自专栏01ZOO

    thanos内核

    maxproc设置小工具 // github.com/opentracing/opentracing-go - tracing // gopkg.in/check.v1;onsi/ginkgo;onsi/gomega

    2.6K20发布于 2019-12-29
  • 来自专栏k8s技术圈

    面向 Kubernetes 开发者的设置指南

    安装 ginkgo 运行以下命令: $ sudo go get -u github.com/onsi/ginkgo/ginkgo $ sudo go get -u github.com/onsi/gomega

    2.4K30发布于 2021-03-01
  • 来自专栏我的小碗汤

    刚刚 Kubernetes 1.25 正式发布,所有变化都在这儿了

    `Ginkgo.Measure`已弃用[9],用gomega/gmeasure代替。 更改了一些 apiserver 指标[10]。

    2.3K41编辑于 2023-03-19
领券