Skip to content

Instantly share code, notes, and snippets.

View TaskRun.yaml
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
name: nodejs-taskrun
spec:
inputs:
resources:
- name: nuxt-repo
resourceRef:
name: nuxt-repo
View TektonTaskSpec.go
type TaskSpec struct {
// Inputs is an optional set of parameters and resources which must be
// supplied by the user when a Task is executed by a TaskRun.
// +optional
Inputs *Inputs `json:"inputs,omitempty"`
// Outputs is an optional set of resources and results produced when this
// Task is run.
// +optional
Outputs *Outputs `json:"outputs,omitempty"`
View Task.yaml
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: nodejs-ci
spec:
inputs:
resources:
- name: nuxt-repo
type: git
steps:
View Resources.yaml
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: nuxt-repo
spec:
type: git
params:
- name: revision
value: master
- name: url
View commitsCollection.js
const commitsCollection = {
"total_count": 4,
"incomplete_results": false,
"items": [
{
"url": "https://api.github.com/repos/octocat/Spoon-Knife/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f",
"sha": "bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f",
"html_url": "https://github.com/octocat/Spoon-Knife/commit/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f",
"comments_url": "https://api.github.com/repos/octocat/Spoon-Knife/commits/bb4cc8d3b2e14b3af5df699876dd4ff3acd00b7f/comments",
"commit": {
View Counter.vue
<template>
<div>
<div class="counter-text">
Counter is: {{ count }}
</div>
<div class="counter-controls">
<button @click="increase">
Increase
</button>
<button @click="decrease">
View counter.spec.js
import {
render,
fireEvent,
cleanup
} from 'vue-testing-library';
import Counter, { INITIAL_COUNTER } from '@/components/Counter.vue'
describe('Component: Counter.vue', () => {
describe('Behavior', () => {
afterEach(() => {
@cdbkr
cdbkr / react-testing-library-clojurescript.cljs
Last active May 11, 2022
React-testing-library and Re-frame clojurescript app
View react-testing-library-clojurescript.cljs
(ns demo.core-test
(:require [cljs.test :refer [deftest
testing
is
use-fixtures]]
[clojure.string :refer [lower-case]]
[demo.components :refer [title-component
counter-component]]
[reagent.core :as r]
["react-testing-library" :as rtl]))
View test.js
<script>alert('test')</script> test
View gist:3124714246d4d2a1024c
const React = require('react');
const ReactAtellier = require('react-atellier')(React);
class AtellierWrapper extends React.Component{
render() {
const Icon = React.createClass({
render: function() {
return (
<div>
hello