[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode c5e7788ce9 044/222: Merge pull request #28
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode c5e7788ce9 044/222: Merge pull request #28 from ananthakumaran/testing |
Date: |
Sun, 6 Feb 2022 16:59:10 -0500 (EST) |
branch: elpa/typescript-mode
commit c5e7788ce9baa8d8a53fcc6d1eca5f120d74962d
Merge: 3b0ace2a71 bf9a4155cc
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: GitHub <noreply@github.com>
Merge pull request #28 from ananthakumaran/testing
Add CI and test-setup
---
.gitignore | 86 ++++++++++++++++++++++++++
.travis.yml | 17 +++++
Makefile | 9 +++
README.md | 2 +
test-files/indentation-reference-document.ts | 92 ++++++++++++++++++++++++++++
typescript-mode-tests.el | 34 ++++++++++
6 files changed, 240 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000..d54dbd59d7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,86 @@
+
+# Created by https://www.gitignore.io/api/emacs,windows,linux
+
+### Emacs ###
+# -*- mode: gitignore; -*-
+*~
+\#*\#
+/.emacs.desktop
+/.emacs.desktop.lock
+*.elc
+auto-save-list
+tramp
+.\#*
+
+# Org-mode
+.org-id-locations
+*_archive
+
+# flymake-mode
+*_flymake.*
+
+# eshell files
+/eshell/history
+/eshell/lastdir
+
+# elpa packages
+/elpa/
+
+# reftex files
+*.rel
+
+# AUCTeX auto folder
+/auto/
+
+# cask packages
+.cask/
+dist/
+
+# Flycheck
+flycheck_*.el
+
+# server auth directory
+/server/
+
+# projectiles files
+.projectile
+
+# directory configuration
+.dir-locals.el
+
+### Linux ###
+
+# temporary files which can be created if a process still has a handle open of
a deleted file
+.fuse_hidden*
+
+# KDE directory preferences
+.directory
+
+# Linux trash folder which might appear on any partition or disk
+.Trash-*
+
+# .nfs files are created when an open file is removed but is still being
accessed
+.nfs*
+
+### Windows ###
+# Windows thumbnail cache files
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# End of https://www.gitignore.io/api/emacs,windows,linux
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..7409597f0f
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,17 @@
+language: generic
+sudo: false
+before_install:
+ - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh
&& source ./x.sh
+ - evm install $EVM_EMACS --use --skip
+ - cask
+
+env:
+ - EVM_EMACS=emacs-24.3-travis
+ - EVM_EMACS=emacs-24.4-travis
+ - EVM_EMACS=emacs-24.5-travis
+ - EVM_EMACS=emacs-25.1-travis
+ - EVM_EMACS=emacs-git-snapshot-travis
+
+script:
+ - emacs --version
+ - make test
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..abaa9bf6c9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,9 @@
+EMACS=$(shell which emacs) -Q -batch -L .
+
+cask:
+ cask build
+
+test: cask
+ + $(EMACS) -l typescript-mode-tests.el -f ert-run-tests-batch-and-exit
+
+# end
diff --git a/README.md b/README.md
index f55f8a4bf8..4d504a6564 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# typescript.el
+[![Build
Status](https://api.travis-ci.org/ananthakumaran/typescript.el.svg?branch=master)](https://travis-ci.org/ananthakumaran/typescript.el)
+
`typescript.el` is major-mode for editing
[Typescript](http://www.typescriptlang.org/)-files in [GNU
Emacs](https://www.gnu.org/software/emacs/).
`typescript.el` is a self-contained, lightweight and minimalist major-mode
diff --git a/test-files/indentation-reference-document.ts
b/test-files/indentation-reference-document.ts
new file mode 100644
index 0000000000..a6df0e6dc0
--- /dev/null
+++ b/test-files/indentation-reference-document.ts
@@ -0,0 +1,92 @@
+/// <reference types="node" />
+/// <reference path="shared.ts" />
+/// <reference path="session.ts" />
+// used in fs.writeSync
+/* tslint:disable:no-null-keyword */
+
+/*
+ * this file is a butchered copy of TypeScript's tsserver.ts file
+ * made to contain the most important syntactical elements
+ * of TypeScript to verify indentation-code.
+ *
+ * It will not build, and that's NOT a problem!
+ */
+
+// namespaces indent.
+namespace ts.server {
+
+ const net: {
+ connect(options: { port: number }, onConnect?: () => void): NodeSocket
+ } = require("net");
+
+ // functions indent.
+ function getGlobalTypingsCacheLocation() {
+ // We know switch/case is indented incorrectly.
+ // TODO: FIX!
+
+ // switch (process.platform) {
+ // case "win32": {
+ // const basePath = process.env.LOCALAPPDATA ||
+ // process.env.APPDATA;
+ // return combinePaths(normalizeSlashes(basePath),
"Microsoft/TypeScript");
+ // }
+ // case "darwin":
+ // case "linux":
+ // case "android": {
+ // const cacheLocation =
getNonWindowsCacheLocation(process.platform === "darwin");
+ // return combinePaths(cacheLocation, "typescript");
+ // }
+ // default:
+ // Debug.fail(`unsupported platform '${process.platform}'`);
+ // return;
+ // }
+ }
+
+ // interfaces and classes indent.
+ interface NodeChildProcess {
+ send(message: any, sendHandle?: any): void;
+ on(message: "message" | "exit", f: (m: any) => void): void;
+ kill(): void;
+ pid: number;
+ }
+
+ class Logger implements ts.server.Logger {
+ private firstInGroup = true;
+
+ // parameter-lists are currently not indented like tsserver wants it
to...
+ // constructor(private readonly logFilename: string,
+ // private readonly traceToConsole: boolean,
+ // private readonly level: LogLevel) {
+ // }
+
+ // function-typed class-members indent.
+ constructor(private readonly logFilename: string) {
+ console.log("yes");
+ }
+
+ static padStringRight(str: string, padding: string) {
+ return (str + padding).slice(0, padding.length);
+ }
+
+ close() {
+ if (this.fd >= 0) {
+ fs.close(this.fd);
+ }
+ }
+ }
+
+ // object initialization/parameter-lists indent.
+ const ioSession = new IOSession(
+ sys,
+ cancellationToken,
+ eventPort,
+ /*canUseEvents*/ eventPort === undefined,
+ useSingleInferredProject,
+ disableAutomaticTypingAcquisition,
+ getGlobalTypingsCacheLocation(),
+ telemetryEnabled,
+ logger);
+ process.on("uncaughtException", function (err: Error) {
+ ioSession.logError(err, "unknown");
+ });
+}
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
new file mode 100644
index 0000000000..fb40785094
--- /dev/null
+++ b/typescript-mode-tests.el
@@ -0,0 +1,34 @@
+
+;;; typescript-mode-tests --- This file contains automated tests for
typescript-mode.el
+
+;;; Commentary:
+;; Run tests using (ert-run-tests-interactively t).
+
+;;; Code:
+
+(require 'ert)
+(require 'typescript-mode)
+
+(defun typescript-test-get-doc ()
+ (buffer-substring-no-properties (point-min) (point-max)))
+
+(defun typescript-test-indent-all ()
+ (delete-trailing-whitespace)
+ (indent-region (point-min) (point-max) nil)
+ (untabify (point-min) (point-max)))
+
+(ert-deftest indentation-reference-document-is-reflowed-correctly ()
+ (let* ((buffer (find-file "test-files/indentation-reference-document.ts")))
+ ;; double ensure mode is active
+ (typescript-mode)
+
+ (let ((test-reference (typescript-test-get-doc)))
+ (typescript-test-indent-all)
+ (should (string-equal test-reference
+ (typescript-test-get-doc))))
+
+ (kill-buffer buffer)))
+
+(provide 'typescript-mode-tests)
+
+;;; typescript-mode-tests.el ends here
- [nongnu] elpa/typescript-mode 4e3850dd2a 105/222: Remove logic handling preprocessor macros, (continued)
- [nongnu] elpa/typescript-mode 4e3850dd2a 105/222: Remove logic handling preprocessor macros, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 32f5034e9d 127/222: Extract tests as general tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e15e2bfa1a 131/222: Add jsdoc tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c0f11efdfd 143/222: Fixing typescript--forward-expression for multiline indented string, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a0f2c3ebd4 164/222: Reimplement template auto conversion as a post-self-insert-hook, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b44b75dbe1 172/222: Add test case for infinite loop, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5bf30fe8d6 175/222: Add member expressions tests involving type parameters., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1c27fb09ed 220/222: Fix cl deprecation warning, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode dd832751ab 217/222: Merge pull request #156 from zkry/fix-dot-after-exclamation-indentation, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4249a20d6d 187/222: Added file for indent test case, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c5e7788ce9 044/222: Merge pull request #28 from ananthakumaran/testing,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 99c2b74ac3 059/222: Make current-column function internal., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 89d22c4e18 051/222: Don't interpret forward slash in list as operator., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 393ac6db0f 081/222: add tests for regexp font locking, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 361564c4a9 057/222: typescript-current-column: Dont cause side-effects., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d155a4b623 063/222: Revert indent of complex parameters., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e0b4a6cb31 055/222: Merge pull request #36 from lddubeau/feature/improved-tslint-regex, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bce2e73cf2 107/222: Remove unused dependencies, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7172a23d86 072/222: Add a custom predicate for flyspell-prog-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d8501770f6 103/222: Fix indentation of multiple curly braces in sequence., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a09e9c78f9 108/222: Highlight class names., ELPA Syncer, 2022/02/06